Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Refactor Template package #65

Merged
merged 12 commits into from
Apr 28, 2016
Merged

Refactor Template package #65

merged 12 commits into from
Apr 28, 2016

Conversation

johanjanssens
Copy link
Member

resolve #64

- Add source parameter to TemplateInterface::render() as the first method argument.
- Remove TemplateInterface::loadString()
- Remove TemplateInterface::loadFile()

BREAKING! The loadString() and loadFile() methods have been removed and the arguments of the render() method have changed. To migrate your code remove calls to loadString() and loadFile() and add the content or url as the first argument to render() call.
- Remove loadString()
- Remove loadFile()
- Remove isDebug()
- Remove setDebug()
- Make data and funtions private variables
- Add getFunctions() to retrieve the list of template functions.
- Set the data in render()
- Add behavior.mixin
- Move TemplateHelperable implementation and interface to helperable behavior
- Move TemplateFilterable implementation and interface to filterable behavior
- Remove cache decoration (to be implemeted as a cacheable behavior)
- Remove loadString()
- Remove loadFile()
- Add getParameter() method and 'parameter' function
- Make render final and implement loading logic in _actionRender() following conventions.
To be implemented through a template behavior.
- Add TemplateHelperFactory to create template helpers
- Add TemplateHelperInterface::createHelper()  to qualify a partial helper identifier before calling the factory
- Remove TemplateHelperInterface::getTemplate()

BREAKING! A helper no longer has a getTemplate() method. The TemplateBehaviorHelperable::invokeHelper() method passes the template object as the second parameter to the helper method being invoked.
- Remove TemplateFilterInterface::getTemplate()
- Pass the template as the second parameter in TemplateFilterInterface::filter()

BREAKING! A filter no longer has a getTemplate() method. The TemplateBehaviorFilterable::filter() method passes the template object as the second parameter.
Markdown filter has been replace by the generic 'template' filter.
Add generic template filter to allow mixing differerent template types in the same template. Syntax <ktml:template:[type]></ktml:template:[type]>
A block element is not a void element and requires a self-closing start tag when using without content. Correct syntax: <ktml:block name="[name]" condition="[condition]" />

See: https://www.456bereastreet.com/archive/201005/void_empty_elements_and_self-closing_start_tags_in_html/

BREAKING! ktml:block elements without content require a self-closing start tag.To migrate add a self-closing tag to empty ktml:block elements.
- Remove TemplateEngineInterface::getTemplate()
- Add TemplateEngineInterface::renderPartial()
- Add TemplateEngineInterface::renderDebug()
- Add TemplateEngineInterface::locateSource()
- Add TemplateEngineInterface::cacheSource()
- Add TemplateEngineInterface::setCache()
- Add TemplateEngineInterface::isCache()
- Make TemplateEngineAbstract::$stack class property private and set it through render() and renderPartial() methods.
@johanjanssens johanjanssens added this to the 3.0.0-beta.2 milestone Apr 26, 2016
@johanjanssens johanjanssens merged commit 8b3ebb7 into master Apr 28, 2016
@johanjanssens johanjanssens deleted the feature/64-template branch April 28, 2016 01:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Template package
1 participant