Skip to content

Commit 3426d72

Browse files
mabarMilan Felix Šulc
authored andcommitted
StructuredTemplates docs
1 parent fa2702e commit 3426d72

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.docs/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [LinkGenerator (LinkGeneratorExtesion)](#link-generator)
66
- [UI](#ui)
77
- [Presenter](#presenter)
8+
- [StructuredTemplates](#structuredtemplates)
89
- [Control](#control)
910
- [Component](#component)
1011
- [Responses](#responses)
@@ -36,6 +37,26 @@ Extending `BasePresenter` you can use these methods:
3637
| `isModuleCurrent($module)` | `boolean` | Is current presenter in given module? |
3738
| `getModuleName()` | `string` | Get current presenter module's name. |
3839

40+
#### Structured Templates
41+
42+
Trait which modifies where are presenter templates located.
43+
44+
- Views
45+
- `%presenterDir%/templates/%view%.latte`
46+
- Layouts
47+
- `%presenterDir%/templates/@layout.latte`
48+
- layouts of parent presenters are also looked for
49+
50+
```php
51+
use Contributte\Application\UI\Presenter\StructuredTemplates;
52+
use Nette\Application\UI\Presenter;
53+
54+
class YourPresenter extends Presenter
55+
{
56+
use StructuredTemplates;
57+
}
58+
```
59+
3960
### Control
4061

4162
- NullControl - displays nothing

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ composer require contributte/application
3535
- [LinkGenerator (LinkGeneratorExtension)](https://github.com/contributte/application/blob/master/.docs/README.md#link-generator)
3636
- [UI](https://github.com/contributte/application/blob/master/.docs/README.md#ui)
3737
- [Presenter](https://github.com/contributte/application/blob/master/.docs/README.md#presenter)
38+
- [StructuredTemplates](https://github.com/contributte/application/blob/master/.docs/README.md#structuredtemplates)
3839
- [Control](https://github.com/contributte/application/blob/master/.docs/README.md#control)
3940
- [Component](https://github.com/contributte/application/blob/master/.docs/README.md#component)
4041
- [Responses](https://github.com/contributte/application/blob/master/.docs/README.md#responses)

0 commit comments

Comments
 (0)