Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Improve documentation #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Features:
- Extensible through conventions and partials
- extensible for other frameworks

# Installation

The package can be installed as usual with composer:

```bash
composer require sandstorm/crudforms
```

# 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.
Expand Down Expand Up @@ -56,13 +64,13 @@ In your Model, annotate the field using the `@Crud\FormField` annotation, which
- `repository`: specify a repository to retrieve option values from (format: full\repository\class\name[::methodName])
- `configuration`: a generic array of configuration options, available everywhere for customizations. By the base classes, the following configuration options are supported:
- `formFieldWrapperClassName`: CSS class name to be applied to the wrapping element for each form field (to have field-specific classes)


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

Just use the `@CrudForms\FormField` annotation as follows:

```
```php
@CrudForms\FormField(label="my label", visibleInOverview=false)
```

Expand All @@ -79,9 +87,9 @@ The editor has the following template variables available:
- property: the name of the property to be edited.
- formFieldClass: this CSS class name should be used as CSS class name for the form field itself

Example:
Example:

```
```html
<f:for each="{field.options}" as="option">
<br />
<f:form.radio property="{field.property}" value="{option.value}" />
Expand Down Expand Up @@ -154,7 +162,7 @@ This is important for version upgrades:
- the method `protected function getModelType()` must be overridden in the `Controller`; it must return the class-name
of the object this controller is responsible for.

```
```php
use Sandstorm\CrudForms\Controller\CrudControllerTrait;
class AddressController extends ActionController
{
Expand All @@ -174,9 +182,9 @@ class AddressController extends ActionController
- `CreateControllerTrait` creates new objects (`new` and `create` actions)
- `UpdateControllerTrait` updates objects (`edit` and `update` actions)
- `RemoveControllerTrait` deletes objects (`remove` actions)


```

```php
use Sandstorm\CrudForms\Controller\BaseControllerTrait;
use Sandstorm\CrudForms\Controller\IndexControllerTrait;
use Sandstorm\CrudForms\Controller\CreateControllerTrait;
Expand All @@ -186,7 +194,7 @@ use Sandstorm\CrudForms\Controller\RemoveControllerTrait;
class AddressController extends ActionController
{
use BaseControllerTrait;

// here, you can remove certain trait imports and manually implement these actions.
use IndexControllerTrait;
use CreateControllerTrait;
Expand Down