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

Refactor Template package #64

Closed
johanjanssens opened this issue Apr 26, 2016 · 0 comments · Fixed by #65
Closed

Refactor Template package #64

johanjanssens opened this issue Apr 26, 2016 · 0 comments · Fixed by #65
Labels
Milestone

Comments

@johanjanssens
Copy link
Member

johanjanssens commented Apr 26, 2016

  • Implement filters using a behaviour approach
  • Implement helpers using a behaviour approach
  • Move loading logic into render() method and remove loadString() and loadFile()
  • Add generic template filter to allow mixing different template types in the same template.

Breaking changes:

  1. TemplateInterface::loadString() and loadFile() methods have been removed and the arguments of the render() method have changed. To migrate remove calls to loadString() and loadFile() and add the content or url as the first argument to render() call.
  2. 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.
  3. A filter no longer has a getTemplate() method. The TemplateBehaviorFilterable::filter() method passes the template object as the second parameter.
  4. ktml:block elements are considered foreign elements accoording to the html5 standard. Foreign elements need to have self-closing start tags when used without content. To migrate add a self-closing tag to empty ktml:block elements.
@johanjanssens johanjanssens added this to the 3.0.0-beta.2 milestone Apr 26, 2016
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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.
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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()
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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.
johanjanssens added a commit that referenced this issue Apr 26, 2016
To be implemented through a template behavior.
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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.
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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.
johanjanssens added a commit that referenced this issue Apr 26, 2016
Markdown filter has been replace by the generic 'template' filter.
johanjanssens added a commit that referenced this issue Apr 26, 2016
Add generic template filter to allow mixing differerent template types in the same template. Syntax <ktml:template:[type]></ktml:template:[type]>
johanjanssens added a commit that referenced this issue Apr 26, 2016
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: http: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.
johanjanssens added a commit that referenced this issue Apr 26, 2016
- 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 added a commit that referenced this issue Apr 26, 2016
ercanozkaya added a commit that referenced this issue Sep 12, 2019
amazeika added a commit that referenced this issue Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant