View Single Post
  #3 (permalink)  
Old 04-07-2008, 12:57 PM
Leif.Högberg Leif.Högberg is offline
Member
 
Join Date: Aug 2007
Location: Sweden
Posts: 52
Send a message via MSN to Leif.Högberg
Default

Quote:
Originally Posted by sawatdee View Post
I am just wondering if anyone has come up with a more elegant way of doing this.
views in the default module will be loaded if the view can't be found in the current module.

Root
  • controllers
  • views
  • modules
    • mymodule
      • controllers
      • views

Using the above structure views placed in the second folder (views) could be loaded from any module.

To make it work you have to pass 'default', pointing to the controllers folder (folder1), to $controller->setControllerDirectory.

After that you can call $this->partial ('some_partial_view.phtml') without the path.

Hope this helps.
Reply With Quote