Re: [PHPTAL] not working - expected behaviour?
Meta tags don't have content actually. Maybe this is about that situation. Murat Corlu On 05/05/2010 12:09 PM, Marco Pivetta wrote: I just noticed that the templating engine is not displaying the content of my tags in this piece of code: tal:attributes and tal:repeat are working, but tal:content is not even fired! I've tried with tal:content="php:var_dump(meta)", which should directly write to the buffer, but it still doesn't work. Is that an expected behaviour? Is "meta" a reserved xml tag? Is it related with the document type (XML+XHTML) that I've set? Do I have to switch to XML only? Thank you in advance for any suggestions :) Marco Pivetta - Ocramius Aethril http://twitter.com/Ocramius ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] "There is no namespace declared" error in v. 1.2.1
Is there a simple way to define a custom namespace globally for all of our templates like tal and metal namespaces? romtek wrote: 2009/11/12 Kornel Lesiński > xmlns stops working when you close element. > > > > > does nothing. > > > > > > > > > should work. It worked. Thank you. -- ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL prefilters
Sounds like good. Good job! I can suggest a solution to running filters with having to chance to exclude some tags. For example minify html, css and javascript content except textarea tags and some special scripts: .. Multiline textarea content This implementation-like solution can give a chance to running global filters with excluding some tags. Maybe.. Murat Çorlu Kornel Lesiński yazmış: I think I've finally figured out decent design for filters in PHPTAL! Implementation is not finished yet! But have a look at the source of PHPTAL/PreFilter.php: http://phptal.org/files/PHPTAL-1.2.1b3.tar.gz There's base abstract class for prefilters. Previously you had to implement interface, now you'll have to extend the class. This change allows me to add new ways of filtering in the future without any breaking changes in the interface. The class has methods like filterDOM($node), filter($source) — you just override which ones you want. You can override all of them at once if you need, all will be called. DOM version lets you edit PHPTAL DOM nodes after they've been parsed and edit exactly what PHPTAL "sees". There's also filterDOMFragment($node) method. I plan to add phptal:filter="name_of_the_filter" attribute, which will let you apply filters selectively, e.g. (this is not implemented yet) IE hates newlines in lists etc. I've replaced PHPTAL->setPreFilter($filter) with PHPTAL->addPreFilter($filter, $name = null). Yes, this means you can have any number of filters without workarounds (finally! :) I wonder if there should be separate method for adding named prefilters for use with phptal:filter only? (e.g. you might want to make JS minification prefilter available, but you don't want to minify entire file). Currently I expect this to be handled within filter, i.e. filter would implement filterDOMFragment() only, and have filterDOM() do nothing. Is that easy to use? Powerful enough? What do you think? ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
Re: [PHPTAL] PHPTAL writes DOCTYPE twice
Macros are very well. It solved my problem. But I added something to solution: We needed plugin-like system to handle "what will assign" by template, not php. Plugin's html assigns will be sent when if only plugin is used on template. So, finally I use a system like this: tal:define="promoteAssings plugin/get_promoters/page_id/10/orientation/1/loads" /> Here, plugin don't send any html. It sends only assign data to promoteAssigns variable. And we are using promoteAssigns variable in plugins.xhtml template. This solved my problem. But maybe someone knows better way. Thank you so much. And sorry my poor English.. Murat Çorlu Kornel Lesiński yazmış: On 02-09-2009 at 10:39:11 Murat Çorlu wrote: We have a problem. We have a master page and a plugin simulation that renders some another templates to called from. For example; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> tal:replace="plugin/get_promoters/page_id/10/orientation/1/loads" /> plugin is an object that has a getter magic function. It handles that parameters and execute-return another template like this: teste When we ran this, PHPTAL adds a DOCTYPE tag more to infront of second template. I didn't understand the problem. Can you give a suggestion? DOCTYPE and XML declaration are stored in PHPTAL's execution context (like a global variable that's prepended to all output) to allow subpages without DOCTYPE to call external macro that defines page layout and adds DOCTYPE, and you've caught PHPTAL red-handed by calling execute() on PHPTAL instance that has already seen a DOCTYPE. I've added workaround for it in SVN. Try it out: svn co https://svn.motion-twin.com/phptal/trunk phptal Consider using more TAL-friendly macros, something like: ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal
[PHPTAL] PHPTAL writes DOCTYPE twice
Hi all! Firstly, thank you much to developers of PHPTal. It's great! We have a problem. We have a master page and a plugin simulation that renders some another templates to called from. For example; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> tal:replace="plugin/get_promoters/page_id/10/orientation/1/loads" /> plugin is an object that has a getter magic function. It handles that parameters and execute-return another template like this: teste When we ran this, PHPTAL adds a DOCTYPE tag more to infront of second template. I didn't understand the problem. Can you give a suggestion? Sincerely, Murat Çorlu ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal