我是codeigniter的新手。我喜欢jFormer,我想知道将jFormer与它集成的最佳方法是什么。
你建议使用jFormer的其他替代方案吗?
答案 0 :(得分:1)
在我看到the jFormer's documentation时,您需要与我创建的smarty集成相似:
// File libraries/Smarty_tpl.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
//smarty class
require "/usr/share/php/smarty3/libs/Smarty.class.php";
class Smarty_tpl extends Smarty {
function __construct(){
parent::__construct();
$smarty_dir = "/usr/share/php/smarty3/libs/";
$this->setTemplateDir(APPPATH."views/templates");
$this->setCompileDir(APPPATH."views/templates_c");
$this->setCacheDir(APPPATH."views/cache");
$this->setConfigDir(APPPATH."views/config");
$this->setPluginsDir(array("$smarty_dir/plugins","$smarty_dir/sysplugins/"));
$this->compile_check= true;
$this->force_compile= true;
$this->caching= false;
$this->cache_lifetime= 86400;
}
}
它的用法:
$this->load->library("smarty_tpl");
$this->smarty_tpl->display("myform.tpl");
当然不要忘记包含css
和js
个文件!