Php 代码点火器+;精明的
我在连接CI和Smarty时遇到问题。 我使用手册制作所有内容,但当我尝试打开页面时,我会看到:Php 代码点火器+;精明的,php,codeigniter,smarty,Php,Codeigniter,Smarty,我在连接CI和Smarty时遇到问题。 我使用手册制作所有内容,但当我尝试打开页面时,我会看到: 致命错误:未捕获-->Smarty:无法加载模板文件“view/index.tpl”确定,我发现。它是视图/模板,但我有一条新的错误消息 致命错误:未捕获-->智能:无法写入文件应用程序/views/compiled/wrt549692a6e7c983_16652543Ok,我发现。它是视图/模板,但我有一条新的错误消息 致命错误:未捕获-->Smarty:无法写入文件应用程序/视图/已编译/wrt
致命错误:未捕获-->Smarty:无法加载模板文件“view/index.tpl”确定,我发现。它是视图/模板,但我有一条新的错误消息
致命错误:未捕获-->智能:无法写入文件应用程序/views/compiled/wrt549692a6e7c983_16652543Ok,我发现。它是视图/模板,但我有一条新的错误消息 致命错误:未捕获-->Smarty:无法写入文件应用程序/视图/已编译/wrt549692a6e7c983_16652543用于CodeIgniter 2。更新至CodeIgniter 3并遵循以下步骤:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH.'third_party/smarty/Smarty.class.php');
class Custom_smarty extends Smarty {
function __construct()
{
parent::__construct();
$this->setTemplateDir(APPPATH.'views/templates/');
$this->setCompileDir(APPPATH.'views/templates_c/');
}
}
?>
$this->custom_smarty->display('test.tpl')代码>
sudo chmod-R 777 templates\u c
。否则,如果您发现无法写入文件的错误,请联系您的托管服务。首先确保templates\u c文件夹存在<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH.'third_party/smarty/Smarty.class.php');
class Custom_smarty extends Smarty {
function __construct()
{
parent::__construct();
$this->setTemplateDir(APPPATH.'views/templates/');
$this->setCompileDir(APPPATH.'views/templates_c/');
}
}
?>
$this->custom_smarty->display('test.tpl')代码>
sudo chmod-R 777 templates\u c
。否则,如果您发现无法写入文件的错误,请联系您的托管服务。首先确保templates\u c文件夹存在