MODX Revolution and php templates

As with any CMS/CMF MODX from there as followers and opponents. Purely subjectively, all this can not be avoided (everyone has their own habits, attitudes, needs, etc.).

But is there any objective reasons? Yes, of course. And in my opinion one of the most serious is its own parser MODX.

At MODX there are a number of private registered , using which even a novice programmer who only knows HTML and perhaps PHP does not know, can collect quite sane website, as there are quite a large number of ready components that can be installed in just two clicks. For example, in order to get on the page menu, you need to register [[Wayfinder?startId=`0`]]

Just a small video demo of the solution for those who are too lazy to read.


So for someone that MODX parser — rescue, and for someone- a headache. Experienced PHP programmer who confidently writes his code in NotePad++, and knowing just a couple of hundred PHP functions, maybe just to get lost in development on MODX. The problem is that whether we like it or not, we are obliged to register at least one MODX-tag in the template. We can't prescribe in MODX-template clean PHP code and load your executable files, and then send that whole thing in your favorite template engine. (I hasten to mention for those of you not familiar with MODX and who wants to kick me a minus for what I the logic in the template you want to stick: MODX-templates are not really templates. Due to such tight integration MODX-parser, MODX-templates are designed so that they will be prescribed MODX tags, which will call the correct objects, and there is already all the logic to work out. Not going completely into the jungle to go, but yeah, that's not cool.).
So not only that, this kind of imperfection is, the problem still arises in the fact that even experienced programmers need to learn a new parser, its rules, the system of caching (and she's not easy), etc., etc.

But personally, I'm a longtime fan of MODX-and, most likely he will never come off, as the opportunities that it gives the admin flexibility, excellent system of control of accesses and many other things, makes you put up with these disadvantages. Although I have long worked for himself some of his methodology development for MODX, the day before yesterday came up with a chip that has much to make life easier, namely PHP templates for MODX.

What is it? This is a new resource type for MODX, which if you specify a static template, in this template you can write clean PHP code. What this allows? This allows you not only to think about the PHP-parser (and not to study it), but use in the development of third-party template engines such as Smarty, Twig, etc.

The idea is supported at the top of MODX, so it is quite possible that MODX will further develop in the direction of minimizing the use of internal parser and wider support for third-party template engines are popular.

Sources:
sourceforge.net/projects/modxphptemplate/ (ready package)
github.com/Fi1osof/phptemplates (the source code with the Builder)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

When the basin is small, or it's time to choose VPS server

Performance comparison of hierarchical models, Django and PostgreSQL

From Tomsk to Silicon Valley and Back