Skip to content

AkenRoberts/CodeIgniter_Smarty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Integrates the Smarty template parser into CodeIgniter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages