Presenter nesting and componentisation
Fast framework supports presenter nesting directly in HTML markup, in a similar way to how current major front-end frameworks allow component nesting with JSX.
This allows for componentisation of presenters and controlling their logic when nested within other presenters.
file presenters/myButton.html
file presenters/myPresenter.html
myPresenter will then output the following html:
properties
By default, globally defined settings (as described in Settings, Properties and the Cascade) of the host presenter will automatically be passed to the nested presenter.
To allow for more specific and ephemeral configuration of the nested presenter, arbitrary properties can be explicitly passed in the markup that then can be processed further by the presenter's code:
file presenters/myPresenter.html
file presenters/myButton.php
If the presenter class defines a public property with the same name as an HTML attribute, the value of the attribute will be set directly.
If you need more control over how the property is processed, you can create a setter method that matches the "set + property name in capital case" pattern. (e.g. setType() to set the $type property).:
file presenters/myButton.php