class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initDoctype() {
$this->bootstrap ( 'view' );
$view = $this->getResource ( 'view' );
$view->doctype ( 'XHTML1_STRICT' );
}
protected function _initView() {
$view = new Zend_View ();
$view->setEncoding ( 'UTF-8' );
$view->doctype ( 'XHTML1_STRICT' );
$view->addHelperPath('../application/views/helpers', 'My_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$viewRenderer->setView($view);
return $view;
}
}
class Zend_View_Helper_Img extends Zend_View_Helper_Abstract
{
public function img()
{
return "this is a img";
}
}
class My_View_Helper_TestHelper extends Zend_View_Helper_Abstract
{
public function testHelper()
{
return "this is a TestHelper";
}
}
<?php echo $this->doctype() ?> <?php echo $this->img() ?> <?php echo $this->testHelper() ?>
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initDoctype() {
$this->bootstrap ( 'view' );
$view = $this->getResource ( 'view' );
$view->doctype ( 'XHTML1_STRICT' );
}
protected function _initView() {
$view = new Zend_View ();
$view->setEncoding ( 'UTF-8' );
$view->doctype ( 'XHTML1_STRICT' );
$options = $this->getOptions ();
$viewOptions = $options ['resources']['view']['helperPath'];
if (is_array ($viewOptions)) {
foreach($viewOptions as $helperName =>$path)
{
$view->addHelperPath ( $path, $helperName );
}
}
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer ();
Zend_Controller_Action_HelperBroker::addHelper ( $viewRenderer );
$viewRenderer->setView ( $view );
return $view;
}
}
[production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" resources.view[] = resources.view.helperPath.My_View_Helper = "../application/views/helpers" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 1 [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有