PHPackages                             gccloud/parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. gccloud/parser

ActiveCodeigniter-third-party[Parsing &amp; Serialization](/categories/parsing)

gccloud/parser
==============

CodeIgniter 3 Parser library extension

v1.0.19(9y ago)166.5k10[3 issues](https://github.com/gccloud/parser/issues)Apache-2.0PHPPHP &gt;=5.3.0

Since Aug 11Pushed 9y ago5 watchersCompare

[ Source](https://github.com/gccloud/parser)[ Packagist](https://packagist.org/packages/gccloud/parser)[ Docs](https://github.com/gccloud/parser)[ RSS](/packages/gccloud-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (20)Used By (0)

CodeIgniter Parser
==================

[](#codeigniter-parser)

CI Parser Library extension (empty tags replacement, extended loops, conditional IF and SWITCH structures, CI Helper calls)

Initial Note
------------

[](#initial-note)

> To see how to load, initialize and use standard methods of the CI Parser Library, see [Template Parser Class Documentation](http://www.codeigniter.com/user_guide/libraries/parser.html)

\## Installation by Composer #### Option 1 : Run composer ```shell composer require gccloud/parser ``` #### Option 2 : or edit /composer.json ```json { "require": { "gccloud/parser": "1.0.\*" } } ``` #### And then run composer update ```shell composer update ```
\## Basic Changes - While parsing a view, all tags found that does not match any data variable will be replaced with an empty string - The Parser will automatically parse any variable loaded in CI via the Loader Class
\## Advanced Examples ### Declaring conditional blocks #### Conditional IF {**if** {*variable*} *condition* *value*}
block to output if condition is TRUE
{**/if**}
OR
{**if** {*variable*} *condition* *value*}
block to output if condition is TRUE
{**else**}
block to output if condition returns FALSE
{**/if**} &gt; the \*condition\* tag may take any value among ==, !=, &lt;&gt;, &lt;, &lt;=, &gt; or &gt;= #### Conditional SWITCH

[](#conditional-switch)

{**switch** {*variable*}}
{**case** *first\_value*}
block to output if the first case matches expected value
{**break**}
{**case** *second\_value*}
block to output if the second case matches expected value
{**break**}
{**default**}
default block to output
{**break**}
{**/switch**}

### Declaring loops

[](#declaring-loops)

{**for** *index* **from** *start\_value* **to** *end\_value* **step** *step\_value*}
output block to loop on with the {*index*} displayed at each step
{/**for**}

### Viewing indexes in an array structure

[](#viewing-indexes-in-an-array-structure)

{*array\_name*}
{**index in** *array\_name*}
{/*array\_name*}

### Calling a Helper in a view

[](#calling-a-helper-in-a-view)

{**helper\_name**(\[*argument\_1* \[, *argument\_2* ...\]\])}
For example :

```

```

will be equivalent to :

```
