-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress on Template Architecture #30
Comments
Travis likes it! https://travis-ci.org/Respect/Template/jobs/4745448 Classes without coverage are those I've mentioned that are without compilation support. |
Please refer to the HtmlTest for some samples of both real time and compilation: https://github.com/Respect/Template/blob/develop/tests/library/Respect/Template/HtmlTest.php And see how easy is to build a basic operator like https://github.com/Respect/Template/blob/develop/library/Respect/Template/Operators/Text.php |
Wow! Impressive! Still reviewing things, but as far as I got: 👍 on the compilation. IMO, you nailed it! One note on the abstract classes of operators though: What do you think of moving the abstract code to an interface and put the concrete code on the Operator class? |
In original post, you have two "title" inside array of posts, I think you want to put "text" in second. |
semantics Could I work on any type of template ? something like: <?php $template = new Xml('template.xml'); // new Yaml('template.yml'); new Rdf('template.rdf'); ?> |
🐼 |
Only XML-based templates I believe. The code relies a lot on DOM. |
Nice! Will get back to this .... |
I've been working on Respect\Template this week and achieved a nice result. My current branch has some killing features:
Given this template:
Would produce this:
There are some other tricks as well. One of them is selective compilation. All templates can be run in real time or compiled in any state. When I say any state, I mean this:
Compiling a template without value:
Will generate something similar to
<h3><?php echo $title;?></h3>
in the final compilation. Now, in any moment, if you feed this template with data before compilation:Since the result is compiled selectively, now we have
<h3>Hello</h3>
in our compiled PHP template. This is a huge performance tool that can save a lot of template logic that doesn't change often like translations, page titles, some links =)All of this is sort of working. Two of the main operators (the abstraction for a template operation) are not compiling their results yet (but they work in real time).
Most of this is tested (behavior style) and doc-commented. I broke BC with the old Template =(
I'm pushing this into the develop branch. Please review!
https://github.com/Respect/Template/blob/develop
@augustohp @henriquemoody @nickl- @iannsp @wesleyvicthor
The text was updated successfully, but these errors were encountered: