- 浏览: 472420 次
- 性别:
- 来自: 济南
-
文章分类
- 全部博客 (470)
- 前言 (1)
- 【sys】centos6.2 (51)
- 【sys】shell (8)
- 【sys】yum (1)
- software (6)
- 【tec】ruby (16)
- 【tec】rails (35)
- 【tec】rails路由 (2)
- 【tec】rails部署 (10)
- 【tec】rails优化 (6)
- 【tec】rails测试 (11)
- 【tec】php (45)
- 【tec】android (1)
- 【tec】ios (125)
- 【data】mysql (11)
- web (6)
- 【life】文学与提升 (2)
- life (36)
- 【life】怀念 (1)
- 【web】nginx (5)
- 【web】网络与安全 (4)
- 工作随笔 (1)
- 【software】svn (5)
- 【script】jquery (10)
- powerEdge (2)
- 杂七杂八 (5)
- 【sys】ubuntu (9)
- 【sys】windows (4)
- 【tec】java (1)
- 【tec】html (3)
- 【tec】c++ (38)
- 【tec】汇编 (1)
- 【data】数据库 (1)
- 【exchange 】学术交流 (1)
- 【tec】域名空间 (1)
- 【tec】编程先知 (1)
- 【tec】网站建设 (7)
- 【sys】mac (24)
- 【sys】seo (1)
- 【tec】wp (1)
- 【software】git (4)
最新评论
-
fireDragonpzy:
呵呵 貌似我网站上的有更新 你从那里看看 这个博客维护的不及时 ...
牛人经典语录 -
Peppermintchz:
还真这么2过啊!!好怀念啊
牛人经典语录 -
fireDragonpzy:
chenhong53 写道你好,我想问一下,能不能给一组精灵数 ...
cocos2d-x事件触发的优先级 -
chenhong53:
你好,我想问一下,能不能给一组精灵数组中的精灵添加触屏优先级, ...
cocos2d-x事件触发的优先级 -
fireDragonpzy:
dreamstar1020 写道谢谢庞兄指点,写的很详细,谢谢 ...
致:上海郑兄(虚拟主机-web服务器搭建)
<?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项目框架搭建(三)【实体篇】Page
2012-10-26 15:24 796详情请参考:【Software Myzone】:http:// ... -
php项目框架搭建(二)【数据库篇】Result
2012-10-26 15:23 740详情请参考:【Software Myzone】:http:// ... -
php编码问题
2012-10-19 08:51 722详情请参考:【Software Myzone】:http:// ... -
php项目框架搭建(一)【数据库篇】BaseDAO
2012-10-19 08:51 779详情请参考:【Software Myzone】:http:// ... -
php之ZendFramewor篇(九)组件:Zend_Controller基础
2012-10-19 08:51 678详情请参考:【Software Myzone】:http:// ... -
php之ZendFramewor篇(五)组件:Zend_Controller基础
2012-10-19 08:51 455详情请参考:【Software Myzone】:http:// ... -
php之ZendFramewor篇(四)常见错误信息
2012-10-18 08:42 508详情请参考:【Software Myzone】:http:// ... -
php请求全过程
2012-10-18 08:42 680详情请参考:【Software Myzone】:http:// ... -
Mac下Zend Studio快捷键
2012-10-17 08:44 1098详情请参考:【Software Myzone】:http:// ... -
php基础知识(五)魔术方法
2012-10-17 08:44 830详情请参考:【Software Myzone】:http:// ... -
Zend Framework布局和视图 Layouts views
2012-10-17 08:44 804详情请参考:【Software Myzone】:http:// ... -
Smarty配置(标准分析)
2012-10-17 08:44 658详情请参考:【Software Myzone】:http:// ... -
zf页面跳转方式
2012-10-17 08:44 744详情请参考:【Software Myzone】:http:// ... -
Zend Engine解释
2012-10-16 14:27 763详情请参考:【Software Myzone】:http:// ... -
Zend Framework+Smarty应用
2012-10-16 14:25 775详情请参考:【Software Myzone】:http:// ... -
为什么PHP文件一般没有结束标记
2012-10-16 14:25 849详情请参考:【Software Myzone】:http:// ... -
.htaccess配置
2012-10-13 15:38 674详情请参考:【Software Myzone】:http:// ... -
Mac下php常见错误信息
2012-10-13 15:38 774详情请参考:【Software Myzone】:http:// ... -
Zend Framework和Smarty在php中的配置
2012-10-13 15:37 747详情请参考:【Software Myzone】:http:// ... -
在Mac OS X中配置Apache + PHP + MySQL
2012-10-09 11:44 737详情请参考:【Software Myzone】http://w ...
相关推荐
- `templates/`:存放模板文件的目录,如`index.tpl`,`about.tpl`等。 - `templates_c/`:Smarty编译后的PHP文件存储位置,这是Smarty将模板转换成PHP的结果。 - `configs/`:配置文件目录,包含如`config.php`,...
2. **配置和实例化**:在`index.php`中,你需要先配置Smarty,包括设置模板目录、缓存目录等,然后实例化一个Smarty对象。例如: ```php $smarty = new Smarty(); $smarty->template_dir = 'path/to/templates'; ...
6. **配置选项**:Smarty允许开发者根据项目需求调整其行为,例如设置默认的模板目录、缓存目录,或者定义自定义的函数和函数插件。 7. **面向对象编程支持**:Smarty支持面向对象编程,可以方便地与现代PHP框架...
#### 二、Smarty 的优势 **2.1 易于学习与使用** Smarty 提供了一套简洁明了的语法结构,这使得即使是初学者也能快速上手。其语法类似于 HTML,因此前端开发者也可以轻松理解和修改模板文件。 **2.2 强大的功能集...
#### 二、Smarty缓存变量 在Smarty中,可以通过各种方法来缓存变量,从而提高页面渲染的速度。例如,通过`assignvar`标签可以定义变量并赋值: ```smarty $content[li].id|cvts:'ctrip_content':'id':'desc'}>$...
整套系统的设计构造,完全考虑大中小企业类网站的功能要求,网站的后台功能强大,管理简捷,支持模板机制,配置中英文双语言版.能够快速的建立您的企业网站。</font></p> 系统特性: 采用流行的php+mysql+smarty设计...
整套系统的设计构造,完全考虑大中小企业类网站的功能要求,网站的后台功能强大,管理简捷,支持模板机制,配置中英文双语言版.能够快速的建立您的企业网站。</font></p> <p><fontface>系统特性: 采用流行的...
### 二、安装与配置Smarty #### 安装过程: 1. **下载安装包**:可以从官方网站(http://samrty.php.net/)下载最新版本的Smarty安装包。 2. **解压文件**:解压下载的安装包到一个合适的目录,通常会解压到项目的`...
在本部分中,辛星主要讲述了PHP模板技术的概念、Smarty模板引擎的使用方法以及模板技术的重要性,并且分享了作者对个人学习和教育编程的态度和承诺。 首先,辛星指出模板技术并不是PHP独有的,它是Web开发中常见的...
新生代企业网站管理系统是一款基于php mysql samrty的免费开源建站系统。整套系统的设计构造,完全考虑大中小企业类网站的功能要求,网站的后台功能强大,管理简捷,支持模板机制,配置中英文双语言版.能够快速的建立...
- **SMARTY实例化**:在PHP代码中,我们需要创建一个Smarty对象实例,然后设置配置参数,如模板目录、缓存目录等。 - **数据绑定**:将PHP变量传递给Smarty实例,这些变量可以在模板文件中使用。 - **编译模板**...
#### 二、PHP标签模板技术 最开始的解决方案是使用PHP标签本身作为模板技术的基础。这种方式通过简单的PHP标签实现了数据的获取和展示的分离。 **1. 数据获取**:比如`getnews.php`负责从数据库中读取新闻数据并...