-- Philip G <[EMAIL PROTECTED]> wrote
(on Wednesday, 06 February 2008, 01:19 PM -0600):
> Forgive the back-to-back emails.
>
> I have a question about Zend_Layout's setup, well, a couple.
>
> First off, isn't it a bit odd to "start" the MVC from Zend_Layout? I
> would think you would "startMVC" from your base loader file
> (index.php) against the Zend_Controller_Front. I don't know. I just
> think it feels odd to "startMVC" from the Layout class when by the
> time the Layout is used, the MVC would have been started (controller
> calls the layout).
Well, technically it's not starting the MVC... it's starting
*integration* with the MVC layer. But I, for one, felt that
Zend_Layout::startMvcIntegration() was getting to be a bit much to type.
startMvc() does a few things:
* Instantiates the layout object and registers it in a static instance
* Instantiates and registers the Layout plugin, to automate rendering
the layout script.
* Instantiates and registers the Layout action helper, to give layout
awareness to your action controllers
> Second one being, how do I get Zend_Layout to auto-recognize a
> "layout" directory? The problem I'm running into is when I specific
> ->setLayoutPath('./layouts'); it doesn't properly prepend my full file
> system path in front of that.
Use
dirname(__FILE__) . '/layouts'
instead of './layouts'; if you want to be real paranoid, use
realpath(dirname(__FILE__)).
This is not a bug of Zend_Layout, but rather a more general PHP issue
regarding include_paths.
> Due to the nature of this app I'm writing, I need Zend FW to
> auto-determine that similar to what it does automatically for
> Zend_View. I notice it finds my layouts if I put them at
> app/module/views/layout.phtml. I'd like to place them within their own
> layouts directory: app/module/views/layouts/layout.phtml. It would
> really be nice to be able to use layouts across modules,
> app/layouts/default.phtml, but it's not a "need" just a "want."
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/