Skip to content

Commit

Permalink
Caching added to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
starychfojtu committed Sep 25, 2017
1 parent 6618751 commit e4ef046
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It is a classic CamelCase naming e.g. MenuViewComponent or CartSummaryViewCompon

namespace AppBundle\Component;

use ViewComponent\ViewComponentInterface;
use Starychfojtu\ViewComponentBundle\ViewComponentInterface;

class MenuViewComponent implements ViewComponentInterface
{
Expand All @@ -66,9 +66,11 @@ Then add your template to one of configured directories.
And finally render your component in the view:

```twig
{{ component('Menu') }}
{{ component('Menu', 60 * 60) }}
```

The second parameter is cache time of the whole component with default set on 0;

## Custom template name

If you want to specify another template name in view component, just add
Expand All @@ -81,7 +83,7 @@ a key with template like this:

namespace AppBundle\SpecialComponent;

use ViewComponent\ViewComponentInterface;
use Starychfojtu\ViewComponentBundle\ViewComponentInterface;

class MenuViewComponent implements ViewComponentInterface
{
Expand Down

0 comments on commit e4ef046

Please sign in to comment.