philsturgeon / codeigniter-helpfulparser

Helpful Parser allows you to use helper functions in your Parser view files using a special syntax.

This URL has Read+Write access

name age message
file README.markdown Thu Jun 18 05:40:25 -0700 2009 Added examples to the README. [philsturgeon]
directory controllers/ Thu Jun 18 05:14:23 -0700 2009 Initial import. [philsturgeon]
directory libraries/ Thu Jun 18 05:16:06 -0700 2009 Vim munched out half the file. [philsturgeon]
directory views/ Thu Jun 18 05:14:23 -0700 2009 Initial import. [philsturgeon]
README.markdown

CodeIgniter-HelpfulParser

I have knocked up a modification to the CodeIgniter Template Parser, which I am calling "Helpful Parser".

Helpful Parser allows you to use helper functions in your Parser view files using a special syntax like the examples below. It will also load any helpers you try to use to save you having to load them yourself within the controller.

Usage

Here are just a few examples of the sort of syntax you can use within your Parser view files. The same syntax can be used on almost any helper file that exists in your CodeIgniter install, even custom helpers or extended ones.

Link

 {url:anchor[$url|$title|'class="somethnig"']}

Form

 {form:form_open['parser_test']}
      {form:form_input['title'|$title|'onclick="this.value=''"']}
      {form:form_input['url'|$url|'onclick="this.value=''"']}
      {form:form_submit[''|'Submit']}
 {form:form_close}

Repeat string

 {string:repeater["repeat this<br/>"|10]}

Native PHP functions

 {strtoupper[$title]} 

Extra

If you'd like to request changes, report bug fixes, or contact the developer of this library, email email@philsturgeon.co.uk