Asia

Smarty with CodeIgniter

Smarty with CodeIgniter

Tudip

24 June 2016

We have been using CodeIgniter with Smarty for quite a few projects. Getting the Smarty to work with CodeIgniter is not straight forward. It has its own set of quirks. The steps below explain how to set up CI to work with Smarty on Windows and Linux (tested on Ubuntu but should work on other flavors too) machines.

  • Requirements
    1. First download CI here
    2. Next download Smarty template here
    3. And lastly download application folder from our website
  • Installation
    1. Unzip CI into the root folder.
    2. Next, unzip smarty into CI’s application/third_party folder.
    3. And then unzip the downloaded application folder and copy it into CI’s application folder.
    4. Change autoload.php from config folder for autoload of parser and smarty library: $autoload[‘libraries’] = array(‘parser’, ‘smarty’)
    5. Make directory application/cache/smarty/compiled, remember to give write permission for created directory.
    6. Make .tpl pages inside views directory. Ex: welcome.tpl
    7. From controller call $this->parser->parse(‘welcome.tpl’, $data);

Now you should be able to view Smarty tpl files 🙂

Tudip Technologies

Tudip Technologies is a value-driven Software Services company. We deliver excellence in dedicated and business-centric web solutions incorporated with innovation and expertise as the tools to achieve business goals. Our high-quality, cost-effective, reliable, and scalable services have helped us build an enduring relationship with our clients and customers.

Latest Posts

  • All Posts
  • Casestudy
  • Cloud
  • Healthcare
  • Ios
  • IOT
  • Java
  • Manufacturing
  • News
  • OTT
  • Supply Chain
  • Support and Maintainance
    •   Back
    • Banking
Cloud-Powered Agility

December 27, 2024

27 December 2024 Introduction: Transforming Chaos into Opportunity Imagine a supply chain where disruptions are predicted before they occur, inventory…

Cloud-Powered Agility

December 24, 2024

Imagine a supply chain where disruptions are predicted before they occur, inventory is optimized in real-time, and every stakeholder works…

Related Posts

  • All Posts
  • Healthcare