module folder structure

hi friends

how to change folder structure modules like this >>>

-protected

----modules

----------backend

----------------- backend modules

----------Frontend

----------------- front end module

You can arrange them any way you like… just rewrite the index to to the frontend module and /admin to the backend module…

Read this article:

http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/

Then re-visit your directory hierarchy. Is the "backend" really just a module, or is it really a separate application?

After reading the article above, I completely restructured my latest Yii project, flattening the dirs HUGELY, and doing away with the need for a "protected" directory altogether. I ended up with (roughly) what was advised in the article above. My only modification was that "common" libraries etc., are NOT really apps. So I ended up with something like:




$HOME/myproject

   _docs   ## prepended with '_' since it's not an app

   _common/

         components/

         config/

         extensions/

         models/

         views/

         www/

               img/

               index.php

               javascript/

               styles/


   backend/

         components/

         extensions/

         models/

         views/

         www/

               img/

               index.php

               javascript/

               styles/


   frontend/

      # SAME directory hierarchy as backend



Advantages?

  1. Flat!

You can go to $HOME/myproject/backend/www, rather than $HOME/myproject/protected/modules/backend/www

  1. Backend doesn’t exist as, e.g., a “module” of front-end.

    The back-end doesn’t have that relationship to the front-end. Both front and back end are apps.

    One doesn’t live inside the other. They’re neighbors; they share the same communal extensions, etc.

  2. In production, you can check out your project to e.g.

    $HOME/emily/src/myproject

    Then, under your "public_html" folder, simply make a symbolic link, e.g.

    $HOME/emily/public_html/backend@ --> $HOME/emily/src/myproject/backend/www

    Voila! Nothing you would want to protect is anywhere near your public_html directory.

:mellow: