gccloud/parser
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"'); ?>
gccloud/parser 适用场景与选型建议
gccloud/parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.52k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2015 年 08 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「library」 「parser」 「codeigniter」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gccloud/parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gccloud/parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gccloud/parser 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
The CodeIgniter Redis package
An MT940 bank statement parser for PHP
Inbox pattern process implementation for your Laravel Applications
Laravel integration for the jsonapi.org parser
统计信息
- 总下载量: 6.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2015-08-11