-1

I am working on application having different modules which are now categories in three categories (lets say cat1, cat2 and cat3) .

How can i add these categories as postfix to write urlManager rules?

so it will read links like this cat1/controller/action

  • yii1 or yii2 ? Please – ScaisEdge Jan 08 '16 at 10:28
  • yii 1 previously i am using session for maintaining cat. and a dropdown to switching between different cat. but now have to use url so that user can open multiple cat. in different tabs on same browser. – user2369563 Jan 08 '16 at 11:00

1 Answers1

0

if your code is actually organized as a module .. or will not take much to bring it .. you can use the features provided by Yii1 for modules

A module is organized as a directory whose name serves as its unique ID. The structure of the module directory is similar to that of the application base directory. To use a module, first place the module directory under modules of the application base directory. Then declare the module ID in the modules property of the application. For example, in order to use the above forum module, we can use the following application configuration:

return array(
   ......
   'modules'=>array('forum',...),
    ......
);

A controller action in a module can be accessed using the route

 moduleID/controllerID/actionID.

see this doc for more detail

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107