portrino/px_validation
Composer 安装命令:
composer require portrino/px_validation
包简介
Extbase validation via TypoScript
README 文档
README
Extbase validation controlled/ overruled via TypoScript for TYPO3 extensions
1 Features
The PxValidation extension enables the possibility to define different validation configuration in your TypoScript for each Extbase-Controller-Action without touching the affected extension itself. This makes it easy to change the default validation behaviour of vendor extensions without changing their code. But the greatest benefit is that it opens the option to declare multiple variants of validation rules within one page tree. It is even possible to nest validation rules, so you can validate child objects.
2 Usage
2.1 Installation
Installation using Composer
The recommended way to install the extension is using Composer.
Run the following command within your Composer based TYPO3 project:
composer require portrino/px_validation
Installation as extension from TYPO3 Extension Repository (TER)
Download and install the extension with the extension manager module.
2.2 Setup
- Include the static TypoScript of the extension.
- Create some TypoScript in your e.g. "site_package" extension to override the validation rules of any other extension
- See example below:
Example:
PHP:
namespace VendorName\ExtensionName\Controller;
class FooController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* action create
*
* @param \VendorName\ExtensionName\Domain\Model\FooBar $fooBar
* @return void
*/
public function createAction(\VendorName\ExtensionName\Domain\Model\FooBar $fooBar) {
...
}
}
TypoScript:
plugin.tx_pxvalidation.settings {
VendorName\ExtensionName\Controller\FooController {
actionMethodName {
fooBar {
# (default 0) if 1, then the validation rules defined in the property, model or controller are NOT executed
overwriteDefaultValidation = 1
objectValidators {
0 = @TYPO3\CMS\Extbase\Annotation\Validate("VendorName\ExtensionName\Domain\Validator\FooValidator", options={"firstOption": value1, "secondOption": 123456})
1 = @TYPO3\CMS\Extbase\Annotation\Validate("VendorName\ExtensionName\Domain\Validator\BarValidator", options={"firstOption": value1})
}
propertyValidators {
foo {
0 = @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
}
bar {
0 = @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
1 = @TYPO3\CMS\Extbase\Annotation\Validate("StringLength", options={"minimum": 3, "maximum": 50})
2 = @TYPO3\CMS\Extbase\Annotation\Validate("VendorName\ExtensionName\Domain\Validator\CustomValidator", options={"firstOption": value1})
}
childObject {
propertyValidators {
subProperty1 {
0 = @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
}
subProperty2 {
0 = @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
}
#...
}
}
}
}
}
}
}
3 Administration corner
3.1 Changelog
Please look into the CHANGELOG file in the extension.
3.2 Release Management
PxValidation uses semantic versioning, which means, that
- bugfix updates (e.g. 1.0.0 => 1.0.1) just includes small bugfixes or security relevant stuff without breaking changes,
- minor updates (e.g. 1.0.0 => 1.1.0) includes new features and smaller tasks without breaking changes,
- and major updates (e.g. 1.0.0 => 2.0.0) breaking changes wich can be refactorings, features or bugfixes.
| PxValidation | TYPO3 | PHP | Support / Development |
|---|---|---|---|
| 4.0.x | 12.4 | 8.1 - 8.3 | features, bugfixes, security updates |
| 3.0.x | 11.5 | 7.4 - 8.2 | bugfixes, security updates |
| 2.0.x | 9.5 - 10.4 | 7.2 - 7.4 | none |
| 1.2.x | 9.5 | 7.2 - 7.4 | none |
| 1.1.x | 6.2 - 8.7 | 5.5 - 7.4 | none |
3.3 Contribution
Pull Requests are gladly welcome! Nevertheless, please don't forget to add an issue and connect it to your pull requests. This is very helpful to understand what kind of issue the PR is going to solve.
Bugfixes: Please describe what kind of bug your fix solve and give us feedback how to reproduce the issue. We're going to accept only bugfixes if we can reproduce the issue.
4 Authors
- See the list of contributors who participated in this project.
portrino/px_validation 适用场景与选型建议
portrino/px_validation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.03k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「validation」 「typo3」 「extbase」 「TypoScript」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 portrino/px_validation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 portrino/px_validation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 portrino/px_validation 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
An interactive tour through the TYPO3 backend.
Adds request-parameter validation to the SLIM 3.x PHP framework
统计信息
- 总下载量: 3.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2016-09-12