Search code examples
yiiyii-extensions

How to add extensions that developed as modules and behavior in ny yii?


How to add extensions that developed as modules in yii? can any one explain extensions as Yii modules and extensions as Yii behavior

Refer


Solution

  • The first part of your Q is a duplicate with this q: https://stackoverflow.com/questions/12008314/modules-in-yii-explain

    regarding the "How to Use Modules" part. Modules are may be the easiest way there to extend yii, since all you need to do is two tiny steps:

    1. Extract the code under base directory /protected/modules.
    2. Declare the used module in the application configuration:

    return array(
      ...
      'module' => ('moduleName', 'some argument', 'another argument'),
      ...
    );
    

    I haighly recommend taking a look at the docs above then User-Module (as code sample) to get a better understanding to yii modules.

    As for "Extending Yii by Behaviors", i have been confused myself for a while about that, until i had a chance to use the Multi-Lingual_Behavior

    There is no typical way for extending Yii with behaviors, simply because there are multiple options (as you can see in the docs here & here) for using (attaching) behaviors to components (application, models, controllers, ...etc)

    That said, most of yii-extensions there are supported with good Usage docs that are enough in most cases to get them working.