// Bootstrap file require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance()->registerNamespace('Zend'); // Initialize Zend_Layout $layout = Zend_Layout::startMvc(); // Set layout script path $layout->setLayoutPath('/path/to/layouts'); // Render layout echo $layout->render('main.phtml');
// Bootstrap file require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance()->registerNamespace('Zend'); // Initialize Zend_Layout $layout = Zend_Layout::startMvc(); // Set layout script path $layout->setLayoutPath('/path/to/layouts'); // Set module-specific layout $layout->setLayout('admin', 'admin.phtml'); // Render layout echo $layout->render('main.phtml');In the above example, the setLayout method is used to specify a different layout template for the "admin" module. When rendering the main layout template, Zend_Layout will automatically use the appropriate module-specific layout if it exists. Package library: Zend Framework