|
|||
|
Hello all,
i recently switched from SmartyView to default Zend_View and Zend_Layout components as i found them really interesting and offer the same functionality as smarty does. Anyway, i have few questions: 1. How could tell Zend_View not to render action views automatically? I would like to set by hand what page needs to be rendered in a specific point of the layout. 2. How to set values for placeholders (eg. $this->layout()->somevar in the view) from the controller? Thanks. Last edited by MiK : 06-03-2008 at 02:04 PM. |
|
|||
|
Ok.. it's official...
Every time i post on the forum an help request, i quickly find the solution in a matter of minutes ![]() Quote:
PHP Code:
PHP Code:
Quote:
PHP Code:
![]() |
|
|||
|
I use to have code in my boot strap that looked for layouts in my layouts directory
Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts')); Now when I try this on RC1 I get cannot redeclare class ........ <?php error_reporting(E_ALL|E_STRICT); ini_set('display_errors', 1); date_default_timezone_set('America/Phoenix'); set_include_path('.' . PATH_SEPARATOR . '../library' . PATH_SEPARATOR . './application/default/models/' . PATH_SEPARATOR . get_include_path()); require_once 'Zend/Controller/Front.php'; Zend_Loader::registerAutoload(); // autoloads stuff as we make calls /** * Setup controller */ $controller = Zend_Controller_Front::getInstance(); $controller->setControllerDirectory('../application/default/controllers'); $controller->throwExceptions(true); // should be turned on in development time Zend_Layout::startMvc(array('layoutPath'=>'../application/layouts')); // run! $controller->dispatch(); -------------------------------------------- I get class Zend_Layout not found. What new code do I need to load layouts? I have found clues but have been unable to fix my problem. Thanks in advance, Sean Last edited by seank : 06-05-2008 at 09:04 PM. |
|
||||
|
For stopping Zend_View from auto-rendering, in your controller try this:
$this->_helper->ViewRenderer->setNoRender(); More detail here. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|