2017 © Pedro Peláez
 

codeigniter-third-party parser

CodeIgniter 3 Parser library extension

image

gccloud/parser

CodeIgniter 3 Parser library extension

  • Monday, November 21, 2016
  • by gccloud
  • Repository
  • 5 Watchers
  • 14 Stars
  • 2,606 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 20 Versions
  • 9 % Grown

The README.md

CodeIgniter Parser

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

, (*1)

Initial Note

To see how to load, initialize and use standard methods of the CI Parser Library, see Template Parser Class Documentation, (*2)


, (*3)

Installation by Composer

Option 1 : Run composer

composer require gccloud/parser

Option 2 : or edit /composer.json

{
    "require":
    {
        "gccloud/parser": "1.0.*"
    }
}

And then run composer update

composer update


, (*4)

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


, (*5)

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}, (*6)

the condition tag may take any value among ==, !=, <>, <, <=, > or >=, (*7)

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}

, (*8)

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}

, (*9)

Viewing indexes in an array structure

{array_name}
{index in array_name}
{/array_name}

, (*10)

Calling a Helper in a view

{helper_name([argument_1 [, argument_2 ...]])}
For example :, (*11)

<form action="{site_url(controller/method/key1/value1/key2/value2)}" role="form" class="form-inline">

will be equivalent to :, (*12)

<form action="<?php echo site_url('controller/method/key1/value1/key2/value2'); ?>" role="form" class="form-inline">

Note that, though arguments are passed to Helpers as strings, they don't require surrounding simple or double quotes when called via the Parser., (*13)

Helper calls can also be nested. For example :, (*14)

{form_open({site_url(controller/method/key1/value1/key2/value2)}, role="form" class="form-inline")}

will be equivalent to :, (*15)

<?php form_open(site_url('controller/method/key1/value1/key2/value2'), 'role="form" class="form-inline"'); ?>

The Versions

21/11 2016

dev-master

9999999-dev https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

21/11 2016

v1.0.19

1.0.19.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

08/11 2016

v1.0.18

1.0.18.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

29/07 2016

v1.0.17

1.0.17.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

03/12 2015

v1.0.16

1.0.16.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

18/11 2015

v1.0.15

1.0.15.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

13/11 2015

v1.0.14

1.0.14.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

06/11 2015

v1.0.13

1.0.13.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

06/11 2015

v1.0.12

1.0.12.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

05/11 2015

v1.0.11

1.0.11.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

26/10 2015

v1.0.10

1.0.10.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

21/10 2015

v1.0.9

1.0.9.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

21/10 2015

v1.0.8

1.0.8.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

21/10 2015

v1.0.7

1.0.7.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

20/10 2015

v1.0.6

1.0.6.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

01/09 2015

v1.0.4

1.0.4.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

01/09 2015

v1.0.5

1.0.5.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

24/08 2015

v1.0.2

1.0.2.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

14/08 2015

v1.0.1

1.0.1.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter

11/08 2015

v1.0.0

1.0.0.0 https://github.com/gccloud/parser

CodeIgniter 3 Parser library extension

  Sources   Download

Apache-2.0

The Requires

 

by Gregory Carrodano

parser library codeigniter