Download the PHP package sandstorm/crudforms without Composer

On this page you can find all versions of the php package sandstorm/crudforms. 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 crudforms

Sandstorm CrudForms

Create easy and extensible CRUD (Create, Read, Update, Delete) forms for Domain Models in Flow and Neos CMS. Customize them through domain model annotations.

Features:

Compatibility and Maintenance

This package is currently being maintained for Neos 2.3 LTS and Neos 3.x. It is stable, we use it in our projects.

Neos / Flow Version Sandstorm.CrudForms Version Maintained
Neos 3.x, Flow 4.x 2.x Yes
Neos 2.3 LTS, Flow 3.3 LTS 1.x Yes

Usage (Kickstart)

You can use the ./flow crudkickstart:crudcontroller command to create a new CRUD controller and Fluid template. You basically only need to specify the model class name which you want to list/edit.

The rendering in the overview and the forms is by default done by introspecting the model class (using reflection); and then depending on the annotated property type the corresponding editor and listing partial is triggered.

Customization

CrudForms is meant to be very heavily customizable; that's why it provides several independent parts for you to use; and you can change and extend every part:

Note that you will still have a controller and a very bare-bones Fluid template in place; so there is a clear extension point which you can use to add custom functionality.

Adjust individual fields

In your Model, annotate the field using the @Crud\FormField annotation, which supports the following options:

hiding properties from listing and forms, sorting them, labeling them

Just use the @CrudForms\FormField annotation as follows:

Adjusting editors

You can use the editor property of the FormField annotation to trigger usage of a custom editor. Furthermore, place the custom editor into Partials/CrudForms/Helpers/Editors/[EditorName].html.

The editor has the following template variables available:

Example:

The following editors are built in, but can of course be overridden:

Custom listing

In the overview page, the rendering of properties values is done depending on the property type through a partial CrudForms/Helpers/ListingType/[type].html. The type is either a simple data type (as returned from the PHP function gettype); or a fully qualified class name with backslashes replaced by underscores.

Inside the partial, you have the value variable available, containing the current value to be shown.

Virtual properties

You can add virtual properties to your model by just annotating the getter method in the model with @Crud\FormField annotation. Then, the respective getter and setter is called to load/store the value.

Dynamic properties

Sometimes, you need to dynamically, based on runtime decisions, decide which fields you want to show. An example is that you have an object with an array field "extraProperties", and depending on settings, you want to store different values.

To implement this, you need to write a class which inherits from \Sandstorm\CrudForms\FieldGeneratorInterface and then annotate your model class with @Crud\FieldGenerator(className="Your\Field\GeneratorClass").

The FieldGeneratorInterface needs to return an array with property paths as key, and a FormField annotation class as value. To denote nested properties, just use "." (The dot) in the property path.

Todo example Todo context

Add content before/after listing of objects

Simply modify your Index.html template, e.g. by wrapping the table with an -ViewHelper.

Add content around the form

Simply modify your Edit.html or New.html template.

Custom actions for each list element

Sometimes, the simple "edit" and "delete" action is not sufficient on the overview for each object; you might want to e.g. implement a "clone" button which clones the object.

This can be implemented by placing a partial inside CrudForms/Actions/Fully_Qualified_Class_Name_With_Underscores_instead_of_Backslash.html.

This partial has the current object available as object.

API

The API is made of two parts - a "public" API, and an "internal" API:

You will use the public API only as long as you do not need to implement an additional base template for Form and Listing. In case you need to do this, you will rely on the "internal" API.

This is important for version upgrades:

Public Controller API

Public Template API

The public template API contains:

Private API

If you override the main Form.html and Listing, you rely on the private API, which means you have to call the correct ViewHelpers with the correct arguments, and trigger the rendering using correctly, just as it is done in the included Listing.html and Form.html.

If you copy these templates to implement another CSS framework, please consider creating a pull request, so everybody can profit from this.

Next steps / possible further development

License & Copyright

MIT-Licensed, (c) Sandstorm Media GmbH 2016-2017


All versions of crudforms with dependencies

PHP Build Version
Package Version
Requires neos/flow Version ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^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 sandstorm/crudforms contains the following files

Loading the files please wait ....