<?php error_reporting (E_ALL & ~E_DEPRECATED & ~E_NOTICE); date_default_timezone_set ( 'Asia/Shanghai' ); define('ROOT_PATH',($ROOT_PATH =dirname(__FILE__))? $ROOT_PATH : '..'); defined ( 'APPLICATION_PATH' ) || define ( 'APPLICATION_PATH', realpath ( dirname ( __FILE__ ) . '/../application' ) ); defined ( 'APPLICATION_ENV' ) || define ( 'APPLICATION_ENV', (getenv ( 'APPLICATION_ENV' ) ? getenv ( 'APPLICATION_ENV' ) : 'production') ); set_include_path ( implode ( PATH_SEPARATOR, array (realpath ( APPLICATION_PATH . '/../library' ), get_include_path () ) ) ); set_include_path ( '.' . PATH_SEPARATOR . '../application/controllers/' . '../application/models/' . '../application/dao/' . PATH_SEPARATOR . get_include_path () ); require_once "Zend/Loader/Autoloader.php"; Zend_Loader_Autoloader::getInstance ()->setFallbackAutoloader ( true ); $registry = Zend_Registry::getInstance (); $config = new Zend_Config_Ini ( '../application/configs/application.ini', null, true ); Zend_Registry::set ( 'config', $config ); $dbAdapter = Zend_Db::factory ( $config->database->db->adapter, $config->database->db->config->toArray () ); $dbAdapter->query ( 'SET names utf8' ); Zend_Db_Table::setDefaultAdapter ( $dbAdapter ); Zend_Registry::set ( 'db', $dbAdapter ); require_once 'Zend/Log.php'; require_once 'Zend/Log/Writer/Stream.php'; $logger = new Zend_Log ( new Zend_Log_Writer_Stream ( '.' . $config->log->logger->path, 'a+' ) ); Zend_Registry::set ( 'logger', $logger ); $view = new Zend_View (); $view->setScriptPath ( './templates/' ); $view->setHelperPath('./templates/helpers', 'Zend_View_Helper'); $registry ['view'] = $view; include_once ("../library/Smarty/Smarty.class.php"); $smarty = new Smarty (); $smarty->caching = false; $smarty->template_dir = "./templates/"; $smarty->compile_dir = "./data/smarty/"; $smarty->cache_dir = "./data/smarty/cache_c/"; //$smarty->left_delimiter = "<{"; //$smarty->right_delimiter = "}>"; $registry = Zend_Registry::getInstance (); $registry->set ( 'smarty', $smarty ); $front = Zend_Controller_Front::getInstance (); $front->setBaseUrl ( '/' ); $front->setParam ( 'useDefaultControllerAlways', true ); $front->setParam ( 'noViewRenderer', true ); $front->setControllerDirectory ( '../application/controllers' ); $front->throwExceptions ( true ); Zend_Session::start(); require_once 'Zend/Application.php'; $application = new Zend_Application ( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap ()->run (); ?>
详细解决方案
php之ZendFramewor篇(2)zf+samrty index.php 配置
热度:496 发布时间:2012-08-25 10:06:20.0
相关解决方案
- index.jsp经过模拟action接口 转发 到login.jsp页面后,页面背景无法显示
- Parameter index out of range (五 > number of parameters, which is 4)
- 求高手看一看!index.jsp可以进,在往上点就出现有关问题了
- tomcat启动出现Caused by: java.lang.StringIndexOutOfBoundsException: String index out解决方法
- JSP有关问题 index.jsp使用meta 页面都跳转不过去
- 小白请问: 关于 index.jsp 中 isValid() == false的异常。 就剩20分了.对不住各位了><
- java.lang.StringIndexOutOfBoundsException: String index out of range: 12
- 为什么数组上标(index)只能为int不能为long
- ora-08102:index key not found,obj#57848,file 六, block 6324(2)
- 索引超出范围。必须为非负值并小于集合大小。参数名: index
- menu控件 异常 索引必须位于该列表的界限内。 参数名: index
- Index”并不包孕“productType1”的定义
- 异常:索引超出范围。必须为非负值并小于集合大小。参数名: index
- 目录超出范围。必须为非负值并小于集合大小。参数名: index(三层)
- http://localhost:49538/TPInfoPlat/index.html没法显示网页,去掉数字就可以显示了
- 急纠结z-index
- datagridview,想实现编辑数据的功能 指定的参数已超出有效值的范围。 参数名: index;”解决办法
- jquery index()的有关问题帮小弟我看下这行代码错在哪
- 指定的参数已超出有效值的范围。 参数名: index,该怎么解决
- ASP.net报错提示:指定的参数已超出有效值的范围。参数名: index,添加OnRowDataBound="gvEditMember_RowD这个事件就报错,该如何处理
- <a href='MyPhoto.aspx?DelID=<%# Eval("album_id") %>&index=hddnPageIndex.value' />解决方法
- http://localhost:2263/biaoyuan/(S(vdgswrvs3qwzo1feus4cm355))/Index.aspx解决思路
- <div id="Layer25" style="position: absolute; width: 127px; height: 67px; z-index: 35
- <div id="Layer25" style="position: absolute; width:1000px; height:1000px; z-index: 35; background-color:red,该如何处理
- |M|小弟我也有搞鬼 <div style="position: absolute; width: 1000px; height: 1000px; z-index: 35; background-color:red"
- OnClick=window.open("/index.aspx")出错?解决思路
- 地址栏出现乱码 http://localhost:45019/WEB/(S(jtlpw455vp3udnbiufilzh45))/index.aspx,该如何处理
- 虚拟主机 index.htm解决办法
- http://www.fname.cn/jts/(S(5afv1k55frqf5iqamlygej55))/index.aspx 為什麼地址欄上會多出一些隨機字符呢
- int index = int.Parse(e.CommandArgument.ToString());该怎么处理