Download the PHP package neimheadh/sonata-annotation-bundle without Composer

On this page you can find all versions of the php package neimheadh/sonata-annotation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sonata-annotation-bundle

Sonata Annotation Bundle

Adds Annotations for Sonata Admin.

The point is to reduce noise, having lots of admin classes with just mappings that don't do anything else should be avoided. Add annotations to your models and you are done. If you need something that is not covered by this bundle, create admin class instead.

This bundle is a fork of the archived KunicMarko\SonataAnnotationBundle.

PHP Version Latest Stable Version Latest Unstable Version

Build Status Coverage Status Scrutinizer Code Quality

Documentation

Installation

1. Add dependency with composer

2. Register the bundle in your Kernel

Configuration

By default we scan all files in your src directory, if you save your entities somewhere else you can change the directory:

How to use

Instead of creating class for Admin it is enough to just add annotation to your entity.

Clear cache:

And you will see Admin appear in your sidebar.

Note that if you can also use class attributes:

Annotations

Admin

Access

If you are using role handler as described here you can add permission per role with this annotation.

This annotation can be used without Admin annotation present. If you have an admin class for your entity you can still use this annotation.

AddChild

You can read more about this here.

This annotation can be used without Admin annotation present. If you have an admin class for your entity you can still use this annotation.

FormField

You can specify action option that would allow you to have different fields or have different configuration for the same field for create and edit action. If not set, field will be used for create and edit. Besides that, you are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

Form fields can also be added on class level through formFields class Admin annotation property:

By default, if any field configured, all field will be available.

ShowField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

Show fields can also be added on class level through showFields class Admin annotation property:

By default, if any field configured, all field will be available.

ShowAssociationField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

ListField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

List fields can also be added on class level through listFields class Admin annotation property:

By default, if any field configured, all field will be available.

ListAssociationField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

DatagridField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

List fields can also be added on class level through datagridFields class Admin annotation property:

By default, if any field configured, all field will be available.

DatagridAssociationField

You are able to set the position of the field. Position 1 would be the first field to render and higher numbers after. If field doesn't have position, it will be rendered after all fields with position.

ExportField

You can add annotation to fields/method that you want to export, also you can add label for the field, if left blank field name will be used as label.

By default, if any field configured, all field will be available.

ExportAssociationField

ExportFormats

You can customize the export formats you want to allow, if this annotation is not present, all formats are shown.

AddRoute

Add custom routes to your admin class:

RemoveRoute

remove already existing routes:

ActionButton

This will add button next to your add button in a list view. Here you can find how the template should look like.

DashboardAction

This will add button to your dashboard block for this entity. Here you can find how the template should look like.

ListAction

DatagridValues

As explained here.

Extending The Admin

Sometimes you need to do something custom and this bundle can't help you with that but you still want to use annotations for most of the other stuff. You can extend our admin class Neimheadh\SonataAnnotationBundle\Admin\AnnotationAdmin and overwrite the methods you want.

And then in your entity you just provide that class


All versions of sonata-annotation-bundle with dependencies

PHP Build Version
Package Version
Requires doctrine/annotations Version ^1.7
sonata-project/admin-bundle Version ^4.0
symfony/config Version ^5.4 || ^6.0
symfony/dependency-injection Version ^5.4 || ^6.0
symfony/finder Version ^5.4 || ^6.0
symfony/http-kernel Version ^5.4 || ^6.0
php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neimheadh/sonata-annotation-bundle contains the following files

Loading the files please wait ....