定制 gccloud/parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 gccloud/parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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