Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well i did it just some days ago, that's the step for integrating smarty system.</p> <ol> <li>Download Smarty from <a href="http://www.smarty.net/download" rel="nofollow">http://www.smarty.net/download</a></li> <li>Put the smarty folder inside application/third_party</li> <li><p>Create smarty.php file in application/libraries and paste this</p> <pre><code>require_once(APPPATH.'third_party/Smarty/libs/Smarty.class.php'); class CI_Smarty extends Smarty { protected $CI; private $module; public function __construct() { parent::__construct(); // get CI istance $this-&gt;CI =&amp; get_instance(); // fetch the calling module, need to check for views inside it $this-&gt;module = $this-&gt;CI-&gt;router-&gt;fetch_module(); // path $this-&gt;setCompileDir(APPPATH . "cache/smarty/compiled"); $this-&gt;setCacheDir(APPPATH . "cache/smarty/cached"); $this-&gt;setTemplateDir(APPPATH . "views/templates"); // to use $this inside our views/template $this-&gt;assignByRef('this', $this-&gt;CI); log_message('debug', "Smarty Class Initialized"); } public function display ($template, $cache_id = null, $compile_id = null, $parent = null) { // automatically add .tpl extension if there is not in $template if (strpos($template,'.') === FALSE) { $template .= '.tpl'; } if ( !empty($this-&gt;module)){ $template = APPPATH . 'modules/' . $this-&gt;module . '/views/' . $template; } // call the original smarty function parent::display($template, $cache_id, $compile_id, $parent); } } /* End of file Smarty.php */ /* Location: ./application/libraries/Smarty.php */ </code></pre></li> </ol> <p>ps: sorry for indentation</p> <p>Now you can use smarty with $this->load->library('smarty') or automatically load it adding smarty to $autoload in the configuration file.</p> <p>Hope this help! ^^</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload