apy/jsfv-bundle
Composer 安装命令:
composer require apy/jsfv-bundle
包简介
Symfony2 Javascript Form Validation Bundle with localisation support
README 文档
README
#This Bundle is no longer maintained.
Over the years, the structure of Symfony forms has evolved and this bundle has tried to follow its evolution without changing its own structure. However, this old structure is not adapted to new versions of Symfony.
Instead of starting from scratch and generate code similar to another Bundle, I'd rather advise you to use this other Bundle.
Changes to use this Bundle are really fast to apply.
It was a real pleasure to offer this kind of bundle for early versions of Symfony.
##Getting Started With JsFormValidationBundle
Compatibility: Symfony >=2.1, <2.4.
This bundle generate automatically a script to perform validations of a form in javascript.
It use the same constraints defined with annotations in your entity or your document.
This bundle is g11n compatible.(i18n + L10n)
Prerequisite
- BazingaExposeTranslationBundle is mandatory (<2.0). This bundle compute and translate messages in javascript.
- A JavaScript framework is recommended. jQuery, Mootools, Prototype, Yui, Dojo, Zepto and ExtJs are already supported. (Create an issue if you want other)
Installation
Please follow the steps given here to install this bundle.
Usage
This bundle is really easy to use. All you need is to call a twig function in your template.
{{ JSFV(form) }}
Template of a simple form:
<!-- MyProjectMyBundle:Default:index.html.twig -->
<!-- Include prerequisite librairies and bundles -->
<script type="text/javascript" src="__YOUR_FRAMEWORK_URL__"></script>
<script type="text/javascript" src="{{ asset('bundles/bazingaexposetranslation/js/translator.min.js') }}"></script>
<script type="text/javascript" src="{{ url('bazinga_exposetranslation_js', { 'domain_name': 'validators' }) }}"></script>
<!-- Call JsFormValidationBundle -->
{{ JSFV(form) }}
<!-- Display the form -->
<form action="{{ path('myform') }}" method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}
<input type="submit" />
</form>
See a full simple example here.
The following documents are available:
- Installation
- Simple Example
- Custom Constraints
- Twig Function
- Configuration
- Assets warmer
- Events
- Overriding the bundle
- Constraints warning
- Reporting a Bug
TODO
- Script all possible constraints
- Manage php, yml and xml defined constraints
apy/jsfv-bundle 适用场景与选型建议
apy/jsfv-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 772.65k 次下载、GitHub Stars 达 92, 最近一次更新时间为 2012 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「i18n」 「javascript」 「form」 「validation」 「l10n」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 apy/jsfv-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 apy/jsfv-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 apy/jsfv-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Easy to use i18n translation PHP class for multi-language websites
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
A custom URL rule class for Yii 2 which allows to create translated URL rules
The bundle for easy using json-rpc api on your project
统计信息
- 总下载量: 772.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 92
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-08-04