定制 omouren/document-id-form-bundle 二次开发

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

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

omouren/document-id-form-bundle

Composer 安装命令:

composer require omouren/document-id-form-bundle

包简介

Provides the "document_id" form type

README 文档

README

Provides the form type "document_id" using Doctrine ODM. Based on the work of Gregwar : FormBundle

Installation

composer require omouren/document-id-form-bundle.

Register the bundle in the application kernel :

<?php
// app/AppKernel.php
//...
public function registerBundles()
{
    $bundles = array(
        ...
        new Omouren\DocumentIdFormBundle\OmourenDocumentIdFormBundle(),
        ...
    );
...

Add the following after the twig block to the configuration :

# app/config/config.yml
# Twig Configuration
twig:
    ...
    form_themes:
        - 'OmourenDocumentIdFormBundle::document_id_type.html.twig'

Usage

The document_id is a field that contains an document id, this assumes you set up javascripts or any UI logics to fill it programmatically.

The usage look like the document field type one, except that the query returns one unique result. One example :

<?php
//...
$builder
    ->add('city', 'document_id', [
        'class' => 'Project\Entity\City',
    ])
    ;

Here ->find($value) will be used.

You can also chose to show the field, by passing the hidden option to false:

<?php
//...
$builder
    ->add('city', 'document_id', array(
        'class' => 'Project\Entity\City',
        'hidden' => false,
        'label' => 'Enter the City id'
    ))
    ;

Using the property option, you can also use another identifier than the primary key:

<?php
//...
$builder
    ->add('recipient', 'document_id', array(
        'class' => 'Project\Entity\User',
        'hidden' => false,
        'property' => 'login',
        'label' => 'Recipient login'
    ))
    ;

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-06-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固