Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]BenneX[/eluser]
[quote author="Phil Sturgeon" date="1245113358"]Might be going a little far.

I think I can get away with just modifying the parse_single() function to allow syntax such as {helpername:helperfunction|"arg1":"arg2":"arg3"}. What do you guys think?[/quote]

Hmm. Sounds very well, but I think it doesn't make very much sense. It won't optimate the work of an theme-designer. The main term of a template-system is to give the theme-designer as few as possible placeholders to allow a great flexability. It should be easy to see what the placeholder will print out to make it easy to pose the dynamic output whereever you want. A call of a function within the views means an untransparent output, because you don't know the format of the returned output. To make it absolutely clear, an easy Example:

Code:
<!-- Here it's easy to handle -->
<div id="content">
&lt;h2&gt;{CONTENT_HEADLINE}&lt;/h2&gt;
&lt;p&gt;{CONTENT_INTRO_TEXT}&lt;/p&gt;
&lt;!-- And here it's impossible to handle --&gt;
&lt;? $this->content->createTable('Headline', $this->data->tableXY, 'cellpadding="0" id="tableXY"'); ?&gt;
&lt;!-- Better is to allow this --&gt;
&lt;h3&gt;{TABLE_XY_HEADLINE}&lt;/h3&gt;&lt;table {TABLE_XY_PARAMS}>
&lt;!-- TABLE_XY_ROW begin --&gt;
<tr>
&lt;!-- TABLE_XY_COL begin --&gt;
<td>{TABLE_XY_VALUE}</td>
&lt;!-- TABLE_XY_COL end --&gt;
</tr>
&lt;!-- TABLE_XY_ROW end --&gt;
</table>
</div>

Okay, a table is not the best example, but you'll see you have full control of the markup. Know it's very easy to add a specific class for advanced styling. You only need to add them in the template-file and see clearly where to do it. A function call is just in one case transparent... when it loads another viewfile but a placeholder is a better solution too.

I love the template-system of phpBB2 very much. Very useful and not overblewed Wink Maybe it can be migrated to ci? What you guys think about?

greetz


Messages In This Thread
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS - by El Forum - 06-16-2009, 04:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB