modules and controller

Hey all

Suppose i have a site named shop.

I created models views and controller for this.

Now i want to create a module with name ‘user panel’

What i want to ask

can i use controllers/modles that i created for my main site with in ‘user panel’ module?

If i can any sample how to do it?

Thnks

Hello,

You may be able to use "root" models inside your new module, but I think it causes dependence.

How do you use these models? Try to import them when is necessary.

You can’t do the same with your “root” controllers. Each module must have it’s own controller. If you know how to use CAction, you may be able to create actions in separated class files and import them inside your controller.




class DefaultController extends Controller

{

    public function actions()

    {

        return array(

            'scroll'=>array(

                'class'=>'application.components.someportlet.actions.SomeClassActionFile'

            ),

        );

    }