承接 saxulum/saxulum-crud 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

saxulum/saxulum-crud

最新稳定版本:2.0-alpha18

Composer 安装命令:

composer require saxulum/saxulum-crud

包简介

Saxulum CRUD

README 文档

README

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

Features

Requirements

  • php: >=5.4,
  • doctrine/common: ~2.4,
  • knplabs/knp-components: ~1.3,>=1.3.1,
  • symfony/form: ~2.8|~3.0,
  • symfony/http-kernel: ~2.8|~3.0,
  • symfony/routing: ~2.8|~3.0,
  • symfony/security: ~2.8|~3.0
  • twig/twig: ~1.2

Installation

Through Composer as saxulum/saxulum-crud.

Usage

Trait

Use the following trait within your controller: Saxulum\Crud\Controller\CrudTrait.

Base configuration

  • crudName: contains the lowercase name of the object, example: sample
  • crudObjectClass: contains the class name of the object, example: Saxulum\Crud\Entity\Sample

Advanced configuration

  • crudRoutePattern: contains a template pattern like: %s_%s
  • crudRolePattern: contains a template pattern like: role_%s_%s
  • crudTemplatePattern: contains a template pattern like: @SaxulumCrud/%s/%s.html.twig

Services

  • crudAuthorizationChecker: contains an instance of the symfony authorization checker
  • crudDoctrine: contains an instance of the doctrine manager registry
  • crudPaginator: contains an instance of a knp paginator
  • crudFormFactory: contais an instance of a symfony form factory
  • crudUrlGenerator: contains an instance of symfony routing url generator
  • crudSecurity: deprecated by symfony 2.7, use crudAuthorizationChecker
  • crudTwig: contains an instance of the twig environment

Twig: form label generation

Use the following extension to use label generation: Saxulum\Crud\Twig\FormLabelExtension.

Within the form template you can use something like this:

{% block form_label %}
    {% spaceless %}
        {% if label is empty %}
            {% set label = prepareFormLabel(form) %}
        {% endif %}
        {{ parent() }}
    {% endspaceless %}
{% endblock form_label %}

Example

The form name is day_edit, there is a collection field comestiblesWithinDay with a subfield called comestible. As you can see the _ within the name will be replaced by a ..

day:
    edit:
        label:
            comestibles_within_day: Consumption
            comestibles_within_day_collection.comestible: Comestible

Advanced names: If you want the underscore within the form name, work with camel case. Which means someFormName_edit will be converted to some_form_name.edit.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-22