承接 gccloud/parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gccloud/parser

最新稳定版本:v1.0.19

Composer 安装命令:

composer require gccloud/parser

包简介

CodeIgniter 3 Parser library extension

README 文档

README

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

Initial Note

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


## 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} > the *condition* tag may take any value among ==, !=, <>, <, <=, > or >=

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

{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

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

Calling a Helper in a view

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

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

will be equivalent to :

<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.

Helper calls can also be nested. For example :

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

will be equivalent to :

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

统计信息

  • 总下载量: 6.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 5
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2015-08-11