On Dec 21, 2006, at 10:45 PM, Jamie wrote:

Unless I'm misunderstanding something, there doesn't seem to be a way
to make a Myghty template without embedding Python? The "<%" syntax
reminds way too much like the spaghetti code I'd expect to see in a
.php file. Why is Myghty considered a templating framework when the
logic is unavoidably intermixed with the presentation?

Every template language lets you mix logic with the template, its a necessity. Whether it makes up its own syntax for doing so, or uses normal Python, you will invariably need to iterate over objects, conditionally print out data, etc. Some template languages impose more limitations on you, to try and ensure you don't put too much logic (and unnecessary logic) in the template. Myghty and others give you more rope you can possibly hang yourself with in exchange for more power.

I generally have very little logic in my templates. The fact that I don't have to remember yet more syntaxes for stuff like loop controls, accessing a variable under an object, or calling a function lightens my mental 'baggage' so that its easier to focus on the task at hand. Plus, there's some techniques that you can do in Myghty that might mix some logic with a template in exchange for some massive speed improvements such as having individual components in a page cache themselves for varying lengths of time.

Of course, Pylons does very little to bind you to any particular template language. Feel free to substitute in Cheetah, Genshi, Kid, or any other template language supporting the TurboGears Plugin API. Genshi is without a doubt the best of the XML-based template languages, and if you like the structure of those I highly recommend it.

Cheers,
Ben

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to