0

私はcodeigniterを初めて使用します。私はjFormerが好きで、jFormerをjFormerと統合するための最良の方法は何でしょうか。

jFormerに代わる他のどのような方法をお勧めしますか?

4

1 に答える 1

1

jFormerのドキュメントを見ると、スマートな統合を作成したのと同じようなものが必要になります。

// 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

于 2012-02-17T10:20:39.267 に答える