Coder Social home page Coder Social logo

codeigniter_smarty's Introduction

CodeIgniter + Smarty

Add Smarty to your CodeIgniter application!

By Eric "Aken" Roberts - Cryode.com

Installation

  1. Copy Files & Directories Copy the contents of the application folder to your own application folder, whatever you may have named it. Smarty 3.1.13 is included, so you do not need to download it separately.

  2. Check Config Settings Check the settings located in application/config/smarty/smarty_settings.php. The default settings work out of the box, but can be adjusted to your liking.

  3. Add Write Permissions to Compile Directory Make sure your server has permission to write to the Smarty compile directory (usually CHMOD 755 or 777 on non-Windows servers).

  4. Update Any Existing Views If you have existing view files, you'll want to update them to use Smarty syntax instead of PHP tags.

    <?php echo $item; ?> would become {$item}

Warnings

  • The use of PHP tags/code in Smarty template files has been completely removed as of Smarty 3.1.0. Any PHP code will be automatically removed when rendered. You'll need to update your existing views to use Smarty syntax.

  • The core Loader file is extended with a MY_Loader.php file, and the view() method is replaced. If you have previously created a MY_Loader file with your own changes, you will need to merge the two files together.

Support

I'll provide limited support for installation/use if needed. Please check the CodeIgniter Forum Thread before contacting me, in case your question has already been covered. If you find a bug or problem with the code, create an Issue here on Github or contact me.

Feature requests are accepted and encouraged. Create a pull request if you're feeling frisky!

What is Smarty?

Smarty is a PHP template engine. In CodeIgniter, it provides a cleaner syntax and additional features for your view files. For information about Smarty and how to use it, please see Smarty's Documentation.

License

Smarty integration is copyright (c) 2013 by Eric Roberts, and is open source under the MIT license. Smarty is copyright (c) New Digital Group, Inc., and is released under the GNU lesser general public license. See included license docs for more info.

Change Log

1.1.0 - March 12, 2013

  • Smarty updated to version 3.1.13
  • New auto-escape variables feature
  • $ci global var changed to $CI
  • CI 3.0 VIEWPATH constant used, when available
  • Licensed properly!

1.0.0 - Jan 27, 2012

Initial release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.