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

Format tables in docs to improve readability #278

Merged
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions docs/book/v2/element/captcha.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ The following methods are specific to the `Captcha` element; all other methods
defined by the [parent `Element` class](element.md#public-methods) are also
available.

Method signature | Description
---------------------------------------------- | -----------
`setCaptcha(array|Laminas\Captcha\AdapterInterface $captcha) : void` | Set the CAPTCHA adapter for this element. If `$captcha` is an array, `Laminas\Captcha\Factory::factory()` will be run to create the adapter from the array configuration.
`getCaptcha() : Laminas\Captcha\AdapterInterface` | Return the CAPTCHA adapter for this element.
`getInputSpecification() : array` | Returns a input filter specification, which includes a `Laminas\Filter\StringTrim` filter, and a CAPTCHA validator.
| Method signature | Description |
|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `setCaptcha(array\|Laminas\Captcha\AdapterInterface $captcha) : void` | Set the CAPTCHA adapter for this element. If `$captcha` is an array, `Laminas\Captcha\Factory::factory()` will be run to create the adapter from the array configuration. |
| `getCaptcha() : Laminas\Captcha\AdapterInterface` | Return the CAPTCHA adapter for this element. |
| `getInputSpecification() : array` | Returns a input filter specification, which includes a `Laminas\Filter\StringTrim` filter, and a CAPTCHA validator. |
44 changes: 22 additions & 22 deletions docs/book/v2/element/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ The following methods are specific to the `Collection` element; all other method
defined by the [parent `Element` class](element.md#public-methods) are also
available.

Method signature | Description
------------------------------------------------------- | -----------
`setOptions(array $options) : void` | Set options for an element of type Collection. Accepted options, in addition to the options inherited from [Element](element.md#public-methods), are: `target_element`, `count`, `allow_add`, `allow_remove`, `should_create_template` and `template_placeholder`. Those option keys respectively call `setTargetElement()`, `setCount()`, `setAllowAdd()`, `setAllowRemove()`, `setShouldCreateTemplate()` and `setTemplatePlaceholder()`.
`allowObjectBinding(object $object) : bool` | Checks if the object can be set in this fieldset.
`setObject(array|Traversable $object) : void` | Set the object used by the hydrator. In this case the "object" is a collection of objects.
`populateValues(array|Traversable $data) : void` | Populate values
`allowValueBinding() : bool` | Checks if this fieldset can bind data
`setCount($count) : void` | Defines how many times the target element will be initially rendered by the `Laminas\Form\View\Helper\FormCollection` view helper.
`getCount() : integer` | Return the number of times the target element will be initially rendered by the `Laminas\Form\View\Helper\FormCollection` view helper.
`setTargetElement($elementOrFieldset) : void` | This function either takes an `Laminas\Form\ElementInterface`, `Laminas\Form\FieldsetInterface` instance or an array to pass to the form factory. When the Collection element will be validated, the input filter will be retrieved from this target element and be used to validate each element in the collection.
`getTargetElement() : ElementInterface|null` | Return the target element used by the collection.
`setAllowAdd($allowAdd) : void` | If allowAdd is set to true (which is the default), new elements added dynamically in the form (using JavaScript, for instance) will also be validated and retrieved.
`allowAdd() : boolean` | Return if new elements can be dynamically added in the collection.
`setAllowRemove($allowRemove) : void` | If allowRemove is set to true (which is the default), new elements added dynamically in the form (using JavaScript, for instance) will be allowed to be removed.
`allowRemove() : boolean` | Return if new elements can be dynamically removed from the collection.
`setShouldCreateTemplate($shouldCreateTemplate) : void` | If shouldCreateTemplate is set to `true` (defaults to `false`), a `<span>` element will be generated by the `Laminas\Form\View\Helper\FormCollection` view helper. This non-semantic `span` element contains a single data-template HTML5 attribute whose value is the whole HTML to copy to create a new element in the form. The template is indexed using the `templatePlaceholder` value.
`shouldCreateTemplate() : boolean` | Return if a template should be created.
`setTemplatePlaceholder($templatePlaceholder) : void` | Set the template placeholder (defaults to `__index__`) used to index element in the template.
`getTemplatePlaceholder() : string` | Returns the template placeholder used to index element in the template.
`getTemplateElement() : null|ElementInterface|FieldsetInterface` | Get a template element used for rendering purposes only
`prepareElement : void` | Prepare the collection by adding a dummy template element if the user want one
`prepareFieldset() : void` | If both count and targetElement are set, add them to the fieldset
| Method signature | Description |
|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `setOptions(array $options) : void` | Set options for an element of type Collection. Accepted options, in addition to the options inherited from [Element](element.md#public-methods), are: `target_element`, `count`, `allow_add`, `allow_remove`, `should_create_template` and `template_placeholder`. Those option keys respectively call `setTargetElement()`, `setCount()`, `setAllowAdd()`, `setAllowRemove()`, `setShouldCreateTemplate()` and `setTemplatePlaceholder()`. |
| `allowObjectBinding(object $object) : bool` | Checks if the object can be set in this fieldset. |
| `setObject(array \| Traversable $object) : void` | Set the object used by the hydrator. In this case the "object" is a collection of objects. |
| `populateValues(array \| Traversable $data) : void` | Populate values |
| `allowValueBinding() : bool` | Checks if this fieldset can bind data |
| `setCount($count) : void` | Defines how many times the target element will be initially rendered by the `Laminas\Form\View\Helper\FormCollection` view helper. |
| `getCount() : integer` | Return the number of times the target element will be initially rendered by the `Laminas\Form\View\Helper\FormCollection` view helper. |
| `setTargetElement($elementOrFieldset) : void` | This function either takes an `Laminas\Form\ElementInterface`, `Laminas\Form\FieldsetInterface` instance or an array to pass to the form factory. When the Collection element will be validated, the input filter will be retrieved from this target element and be used to validate each element in the collection. |
| `getTargetElement() : ElementInterface \| null` | Return the target element used by the collection. |
| `setAllowAdd($allowAdd) : void` | If allowAdd is set to true (which is the default), new elements added dynamically in the form (using JavaScript, for instance) will also be validated and retrieved. |
| `allowAdd() : boolean` | Return if new elements can be dynamically added in the collection. |
| `setAllowRemove($allowRemove) : void` | If allowRemove is set to true (which is the default), new elements added dynamically in the form (using JavaScript, for instance) will be allowed to be removed. |
| `allowRemove() : boolean` | Return if new elements can be dynamically removed from the collection. |
| `setShouldCreateTemplate($shouldCreateTemplate) : void` | If shouldCreateTemplate is set to `true` (defaults to `false`), a `<span>` element will be generated by the `Laminas\Form\View\Helper\FormCollection` view helper. This non-semantic `span` element contains a single data-template HTML5 attribute whose value is the whole HTML to copy to create a new element in the form. The template is indexed using the `templatePlaceholder` value. |
| `shouldCreateTemplate() : boolean` | Return if a template should be created. |
| `setTemplatePlaceholder($templatePlaceholder) : void` | Set the template placeholder (defaults to `__index__`) used to index element in the template. |
| `getTemplatePlaceholder() : string` | Returns the template placeholder used to index element in the template. |
| `getTemplateElement() : null \| ElementInterface \| FieldsetInterface` | Get a template element used for rendering purposes only |
| `prepareElement : void` | Prepare the collection by adding a dummy template element if the user want one |
| `prepareFieldset() : void` | If both count and targetElement are set, add them to the fieldset |
Loading