Welcome Guest, Not a member yet? Register   Sign In
HelpfulParser - Need testing
#11

[eluser]IvanBernat[/eluser]
I actually think this is fine, I'll give it a try next week in a prototype for a project I'm working on and give you some feedback
#12

[eluser]Phil Sturgeon[/eluser]
How do people feel about this syntax? I'm trying to work out if I should put this into PyroCMS but not sure it is clean enough.
#13

[eluser]sophistry[/eluser]
i've been following this because i am addicted to templating and parsers, but i am not planning to use this parser extension (i've gotten used to PHP templates after detoxing from years of smarty) so take my feedback lightly...

why does the template creator-being have to put the filename of the file where the function exists? why not just let the helper functions be called without the colon?

{site_url}

is a lot simpler than

{urlConfusedite_url}

also,
Code:
{url:anchor[$some_title|$some_link]}
looks a lot like:
Code:
<? echo anchor($some_title,$some_link) ?>

are you working with a template designer? meaning, an actual person who is using this? what do they think?
#14

[eluser]Phil Sturgeon[/eluser]
I'm just throwing ideas around. I put up a poll for PyroCMS asking whether I should use Smarty, Template Lite or try and mod the existing parser. The results came in and people chose the parser.

The reason for url: going before it is so it knows which helper to load if its missing. You would only need to do that once really and after that you could just use {site_url as it would already be loaded. Perhaps xwero's suggestion of {{url}} to load a helper could be the way forward.

I am just looking for a way to access functions & helpers in Parser that works as smoothly as modifiers in Smarty. So far, not having much luck.

This is not just for designers/developers to look at. I am trying to make something simple and readable enough to parse user generated content from with a "Syntax help" button next to all WYSIWYG inputs.
#15

[eluser]sophistry[/eluser]
using {{url}} is better, but still forces a "link" between the actual filename and the helper function. anyone working in a template shouldn't have to care or know what file the helper function sits in. the function names have to be unique anyway so adding that {{url}} seems just for lazy loading... but, you could do the same thing by figuring out which functions the template wanted then figuring out which file to load - that could all happen out of the template in the loader code.

also, one observation about Smarty template syntax: it centers on the variable and then an operation on that variable which is how english works: we say "the programmer codes." not "codes the programmer."

function-centric templates (as opposed to variable-centric) force you to think about the verb first.

btw, well done stirring the pot here - your work is undeniably fruitful!

cheers.




Theme © iAndrew 2016 - Forum software by © MyBB