Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Add documentation for HelperTrait for IDE auto-completion
Browse files Browse the repository at this point in the history
  • Loading branch information
thexpand committed Sep 12, 2018
1 parent e633986 commit 537029b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/book/view-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ behaviors for you.

See the section on \[view helpers\](zend.view.helpers) for more information.

> ### IDE auto-completion in templates
>
> The `Zend\Form\View\Helper\HelperTrait` trait can be used to provide
> auto-completion for modern IDEs. It defines the aliases of the view helpers in
> a DocBlock as `@method` tags.
>
> #### Usage
>
> In order to allow auto-completion in templates, `$this` variable should be
> type-hinted via a DocBlock at the top of your template. It is recommended that
> you always add the `Zend\View\Renderer\PhpRenderer` as the first type, so that
> the IDE can auto-suggest the default view helpers from `zend-view`. Next,
> chain the `HelperTrait` from `zend-form` with a pipe symbol (a.k.a. vertical
> bar) `|`:
> ```php
> /**
> * @var Zend\View\Renderer\PhpRenderer|Zend\Form\View\Helper\HelperTrait $this
> */
> ```
>
> You may chain as many `HelperTrait` traits as you like, depending on view
> helpers from which Zend Framework component you are using and would like to
> provide auto-completion for.
## Standard Helpers
## HTML5 Helpers
Expand Down

0 comments on commit 537029b

Please sign in to comment.