dd/evolutioncms-snippets-ddgetparentid
Composer 安装命令:
composer require dd/evolutioncms-snippets-ddgetparentid
包简介
Gets document parent ID(s) of the required level.
README 文档
README
Gets document parent ID(s) of the required level.
Requires
- PHP >= 5.6
- (MODX)EvolutionCMS >= 1.1
- (MODX)EvolutionCMS.libraries.ddTools >= 0.60
Installation
Using (MODX)EvolutionCMS.libraries.ddInstaller
Just run the following PHP code in your sources or Console:
//Include (MODX)EvolutionCMS.libraries.ddInstaller require_once( $modx->getConfig('base_path') . 'assets/libs/ddInstaller/require.php' ); //Install (MODX)EvolutionCMS.snippets.ddGetParentId \DDInstaller::install([ 'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddGetParentId', 'type' => 'snippet' ]);
- If
ddGetParentIdis not exist on your site,ddInstallerwill just install it. - If
ddGetParentIdis already exist on your site,ddInstallerwill check it version and update it if needed.
Manually
1. Elements → Snippets: Create a new snippet with the following data
- Snippet name:
ddGetParentId. - Description:
<b>1.4</b> Gets document parent ID(s) of the required level.. - Category:
Core. - Parse DocBlock:
no. - Snippet code (php): Insert content of the
ddGetParentId_snippet.phpfile from the archive.
2. Elements → Manage Files
- Create a new folder
assets/snippets/ddGetParentId/. - Extract the archive to the folder (except
ddGetParentId_snippet.php).
Parameters description
-
id- Desctription: Document Id.
- Valid values:
integer - Default value:
[*id*](current document)
-
level- Desctription: Parent level.
- Valid values:
1— the immediate parent2— the parent of the immediate parent-1— the last parent-2— the parent before the lastinteger— etc
- Default value:
1
-
result_itemsNumber- Desctription: The number of parents that will be returned.
- Valid values:
integer'all'
- Default value:
1
-
result_itemTpl- Desctription: Template for output.
Empty items after parsing the template will be ignored (you can calling third-party snippets in the template and set your own display conditions).
Available placeholders:[+id+]— Parent ID.
- Valid values:
stringChunkNamestring— use inline templates starting with@CODE:
- Default value:
'@CODE:[+id+]'
- Desctription: Template for output.
-
result_itemsGlue- Desctription: The string that combines items while rendering.
- Valid values:
string - Default value:
''
-
result_toPlaceholder- Desctription: Returns value to the placeholder.
- Valid values:
01
- Default value:
0
-
result_toPlaceholder_name- Desctription: Placeholder name.
- Valid values:
string - Default value:
'ddParent'
Examples
Run the snippet through \DDTools\Snippet::runSnippet without DB and eval
//Include (MODX)EvolutionCMS.libraries.ddTools require_once( $modx->getConfig('base_path') . 'assets/libs/ddTools/modx.ddtools.class.php' ); //Run (MODX)EvolutionCMS.snippets.ddGetParentId \DDTools\Snippet::runSnippet([ 'name' => 'ddGetParentId', 'params' => [ 'level' => -1 ] ]);
Links
dd/evolutioncms-snippets-ddgetparentid 适用场景与选型建议
dd/evolutioncms-snippets-ddgetparentid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「modx」 「MODX Evo」 「evo」 「modx evolution」 「evo cms」 「evolution cms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dd/evolutioncms-snippets-ddgetparentid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dd/evolutioncms-snippets-ddgetparentid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dd/evolutioncms-snippets-ddgetparentid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Evolutionize the way you write Laravel code
Snippet runs necessary snippets with necessary params.
A snippet for sending users' feedback messages to a required email, slack and telegram chats or SMS through sms.ru. It is very useful along with ajax technology.
A snippet for fetching and parsing resources from the document tree or custom DB table by a custom rule.
Tools for modifying strings.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-09-03