I guess the best way to start with “marketing” mplate is by seeing if it’s worth being marketed. So, dear PHP community, what do you think about mplate?
Before discussion opens, here’s some short reservations from my side. Sure thing, much of it is a matter of taste. I made mplate because I think that stuff like
<?php foreach($foo as $bar): ?>
<li>toink<?php echo $bar; ?>
<?php if($bar=="banana"): ?>
<i>(a banana)</i>
<?php endif; ?>
</li>
<?php endforeach; ?>
is a horrible read, but surely not everyone thinks so. If you make your views like this and are comfortable with it, mplate might very well be useless baggage for you.
Conversely, mplate templates, as per the default settings, might still scare away the “template designer” if that’s how you work. Nevertheless, especially with the jspish setting, a template should work pretty well when directly viewed in a browser.
I don’t really believe in the idea that the HTML designer really only gets HTML to write; after all, it’s a dynamic web page that we’re making; You wouldn’t duplicate all header and footer code into every HTML file either, so there always must be -some- magic going on. To my experience, professionals who are able to put out decent HTML are perfectly comfortable with words like “foreach” and “if”. But once again, this is much a matter of taste as well; if a thin amount of easy-to-read code inside the view file is too much for you or your colleague, mplate is probably not for you.
Related to the above note, mplate does not have (and will not have) any “security” features that prevent the template author from running certain code, such as plain PHP. I cannot imagine those would help anyone (or, at least, anyone for whom a template system like Farty is a good choice at all to begin with). If you trust the people touching a page’s templates so badly that you need such features, maybe your business model just sucks (that, or I missed something vital).
So, that about rounds up my little rant, now it’s time for you! I’d really appreciate it if some of you hardcore PHP gurus could tell me what you think. Comments are open!
I think I like being the first to comment!
Seriously, I will look at it with an open mind because I’m only starting to use php in a commercial world and think templating is a necessary skill to use. I had looked at Smarty some time ago, but wasn’t hooked enough to use it.
I like the use of php syntax, and for those developers who do code and HTML it’s not a problem to use language constructs such as foreach.
To be honest I wanted to do something like this myself but it’s a big task if your doing other work as well, so I hope this is a useful template system.
On a final point, I think making the name derived from Smarty may be detrimental as it suggests it’s a variation of it, or a copy etc. I think a name that stands it apart would be better. Temphplate or phpViewz are a bit weird but says it all, or just go for something different but memorable such as Divorce - separation, but better. Must get off the drugs!
Wow, a comment!! Thanks! :-)
You’ve a good point about the name there, and indeed this thing needs a rename quick. “Divorce” sounds a bit negative though :-) Good joke though :D
Either way, I hope you’re tempted to give this one a try - you can be assured that it’ll stay under rapid development.
Currently moved good error messages to the top of my list as per a comment on comp.lang.php - because basically anything parses and gets transformed to PHP, a developer often gets PHP error messages in the compiled file. That sucks, of course, so a cool friendly solution is necessary. Any other requests will be considered, too.
interesting post, will come back here, bookmarked your site
Hey, you’ve caught a good idea!
I have done something similar, you can check it at http://andreyshubin.com/updates/Hoduli
It seems to me that Hoduli is more flexible :)