Re: [PHPTAL] use of 'structure' with custom PHPTAL modifier

2013-09-09 Thread Kornel Lesiński
On Tue, 03 Sep 2013 22:27:56 +0100, Chris Young chris.wisef...@gmail.com wrote: *Invalid TALES path: 'structure /some/path', expected 'structure /some/path' to be variable name* Is there something simple I'm missing? I understand I *could* do: span tal:content=structure abbrev: /some/path /

[PHPTAL] Code Generator refactoring

2013-01-08 Thread Kornel Lesiński
A while ago I thought about creating PHP *optimizer*. The goal is to make PHPTAL-generated code as efficient as hand-written code, e.g. merge adjacent strings and echo statements (implemented) and avoid pushState() calls or maintenance of repeat/xx/key variables when those features are

Re: [PHPTAL] XML Namespace and xmlns declaration removed from emitted DOM

2012-06-12 Thread Kornel Lesiński
it as either HTML5 or XHTML). -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] PHP5.4 compatibility

2012-06-06 Thread Kornel Lesiński
is unaffected by charset declaration for ASCII-based encodings (PHPTAL does not support non-ASCII-based encodings). -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Bug when popping context

2012-05-09 Thread Kornel Lesiński
been going back and forth on this for a while. I wonder whether stack of contexts for macros should be handled separately (pushSlotContext() rather than pushContext())... -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion

Re: [PHPTAL] How about Composer?

2012-04-10 Thread Kornel Lesiński
addition of composer.json to the archive. Could you make a pull request on GitHub with this? -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

[PHPTAL] Re: PHPTAL and PHP5.3 Namespace

2012-03-28 Thread Kornel Lesiński
dissatisfied with PHP namespace implementation: http://pornel.net/phpns -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] ZTal 1.3.0

2012-03-27 Thread Kornel Lesiński
it :) Thank you! -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] ZTal 1.3.0

2012-03-27 Thread Kornel Lesiński
On Tue, 27 Mar 2012 19:58:42 +0100, Marco Pivetta ocram...@gmail.com wrote: Cool stuff, but I already moved to ZF2 here... You're definitely an early adopter! -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http

Re: [PHPTAL] Escape PHP tags '? ?' on HTML Comments !-- //--

2012-02-01 Thread Kornel Lesiński
? blocks for PHP code (and always use ?php ) then you can disable short_open_tag setting. Otherwise you need to change ?xml to something else or output it using ?php echo '?xml'; ? -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL

Re: [PHPTAL] Documentation needs updating about tal:on-error

2011-12-05 Thread Kornel Lesiński
. Thanks for suggestion, I've rewritten that bit. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Re: Cleaning cache files

2011-10-07 Thread Kornel Lesiński
frequently. If you've unexpectedly created a lot of cached content, then perhaps cache key contain values that change too frequently? (e.g. mistakenly use current time rather than modification time). -- regards, Kornel Lesiński ___ PHPTAL mailing

Re: [PHPTAL] Cleaning cache files

2011-10-06 Thread Kornel Lesiński
. You might have more luck with method Marco linked to — find command can deal with lots of files and you can run cleanup as often as you need. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com

Re: [PHPTAL] tal:condition question

2011-09-23 Thread Kornel Lesiński
tal:condition=not:tmp/${offers/idoffer}/td -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Escaping ${} and $

2011-09-02 Thread Kornel Lesiński
as ${} in generated HTML. Thanks, please consider the attached patch to the manual. Excellent! Thanks! http://phptal.org/manual/en/split/variableRefs.html -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com

Re: [PHPTAL] Escaping ${} and $

2011-09-01 Thread Kornel Lesiński
On 1 wrz 2011, at 14:56, Tarjei Huse tar...@scanmine.com wrote: Hi, I'm trying to include a JQuery template containing ${} into a PHPTal template. Is there a way to say do not use phptal within this block or just escape the $ signs? Yes, $${} will be printed as ${} in generated HTML. --

Re: [PHPTAL] Any updates to translation tools?

2011-08-23 Thread Kornel Lesiński
from the single source file. I don't know of any for Markdown, so if reStructuredText has good (post)processors, it might be better. Otherwise, I'll probably write something myself. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL

Re: [PHPTAL] Any updates to translation tools?

2011-08-19 Thread Kornel Lesiński
On Sat, 06 Aug 2011 17:07:05 +0100, Anton Andriyevskyy x.meg...@gmail.com wrote: (sorry for late reply, I've originally sent that e-mail from wrong account!) I still want to help and finish translation of phptal documentation to russian language (previously started and done 40% of

Re: [PHPTAL] Browser Based TAL Inspection Tool

2011-08-19 Thread Kornel Lesiński
On Fri, 19 Aug 2011 07:08:22 +0100, Darrell Hamilton darre...@4over.com wrote: Even with a tool like PHPTAL, the array templates for extremely dynamic sites can become difficult to manage, from a designer's point of view. So, my thought was to use prefilters to modify the rendered markup,

Re: [PHPTAL] Google +1 Button

2011-07-23 Thread Kornel Lesiński
-formed XML. Correct usage of prefixed names in XML requires that every prefix is declared with xmlns, e.g.: g:plusone xmlns:g=http://plus.google.com/;/g:plusone -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http

Re: [PHPTAL] tal:attributes and checkboxes

2011-07-15 Thread Kornel Lesiński
x to be truthy/falsy, it will work. Reading session directly in the template is probably a stretch, but you could do something like: $phptal-favorite_checked = $_SESSION[...]; -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion

Re: [PHPTAL] PHPTAL interpreter takes too long to recover from encountering an unterminated HTML element

2011-07-15 Thread Kornel Lesiński
are be replaceable. You can write HTML one if you want :) -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] i18n:domain Attribute

2011-06-28 Thread Kornel Lesiński
use it for whatever you want. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] [PATCH] Shouldn't skip over __get() just because __isset() was defined…

2011-06-28 Thread Kornel Lesiński
the other way. Thank you for your patch. It's not fun to reject patches, I'm sorry for that. You're of course free to use modified version of PHPTAL if you wish. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http

Re: [PHPTAL] [PATCH] Shouldn't skip over __get() just because __isset() was defined…

2011-06-27 Thread Kornel Lesiński
. If you have lazily-loaded properties, then you should simply return *true* from __isset() for such properties. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Lets boost PHPTAL support in PHPSTORM!

2011-06-27 Thread Kornel Lesiński
On Mon, 27 Jun 2011 11:03:48 +0100, Anton Andriyevskyy x.meg...@gmail.com wrote: For everyone who loves PHPTAL, please spend 2 minutes and vote for PHPTAL support in PhpStorm IDE. Here is the link: http://youtrack.jetbrains.net/issue/WI-2593?projectKey=WI Voted :) -- regards, Kornel

Re: [PHPTAL] setting slots in any context

2011-06-21 Thread Kornel Lesiński
. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Extending namespace

2011-06-11 Thread Kornel Lesiński
-compatibility. I do plan to rewrite code generation someday, but until then you're safe :) -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Usage of __toString magic method

2011-06-07 Thread Kornel Lesiński
it in? Unfortunately there are still servers out there with such old php versions. Let's give them another reason to update seriously outdated—and likely insecure—software. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http

Re: [PHPTAL] Implementing phptal modifiers as static methods in multiple classes

2011-06-05 Thread Kornel Lesiński
register all prefixes, but only before template is compiled. To do it, extend PHPTAL class and: function parse() { // register 300 prefixes here :) return parent::parse(); } This way you won't get performance hit at run time. -- regards, Kornel Lesiński

Re: [PHPTAL] Unit Tests

2011-06-02 Thread Kornel Lesiński
would want to know about PHPTAL internals, so I don't recommend that. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] i18n translate - Unable to find variable

2011-05-28 Thread Kornel Lesiński
=string:login or email -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Evaluating tal:attributes Generated By PreFilters

2011-05-11 Thread Kornel Lesiński
PHPTAL_Dom_Element(translation,,array(), $child-getXmlnsState()); $wrapper-setAttributeNS('http://xml.zope.org/namespaces/tal', 'attributes', token $token); -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion

Re: [PHPTAL] issue with variable defined in a full page macro

2011-05-07 Thread Kornel Lesiński
of a slot. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] new tag

2011-04-23 Thread Kornel Lesiński
, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] PHPTAL and ZTal

2011-04-14 Thread Kornel Lesiński
On Thu, 14 Apr 2011 13:42:55 +0100, Robert Goldsmith rgoldsm...@names.co.uk wrote: Regarding a repository of useful tales, I'd be keen to see a (maybe optional) download from the PHPTAL site with a collection of well written common tales both to help developers writing their own and to

Re: [PHPTAL] tal:equal ?!

2011-04-13 Thread Kornel Lesiński
If the condition is related to your business rules, then I think that's the most appropriate way to do it. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] translate ...

2011-02-13 Thread Kornel Lesiński
On Sun, 13 Feb 2011 17:03:50 -, GRolf ger...@pictureparking.com wrote: And another question relating the i18n:translate in templates: the regular gettext contains xgettext to extract all keys from a PHP source code so you don't forget to translate one... does something similar exist

Re: [PHPTAL] translate ...

2011-02-13 Thread Kornel Lesiński
-i18n.tgz I've committed it to the repository. Thanks! -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

Re: [PHPTAL] Ztal 1.0.0

2010-12-18 Thread Kornel Lesiński
as a replacement for the Zend_View class and Zend_Form class. Thanks very much for this! And congratulations — that is a really nice code! -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com

Re: [PHPTAL] Feature request: better integration with doctrine orm

2010-11-22 Thread Kornel Lesiński
On 22 Nov 2010, at 12:35, Ivo Võsa wrote: seams like today is feature request day :) so here goes mine. I'm using phptal with Doctrine ORM. Unfortunately Doctrine and phtpal have different understanding about what exactly isset means. So every time i upgrade phptal i have to apply this

Re: [PHPTAL] Feature request: better integration with doctrine orm

2010-11-22 Thread Kornel Lesiński
On 22 Nov 2010, at 13:01, Ivo Võsa wrote: seams like today is feature request day :) so here goes mine. I'm using phptal with Doctrine ORM. Unfortunately Doctrine and phtpal have different understanding about what exactly isset means. So every time i upgrade phptal i have to apply this

Re: [PHPTAL] Re: Feature request: Allow array as parameter of PHPTAL's set() method

2010-11-22 Thread Kornel Lesiński
On 22 Nov 2010, at 14:58, Tjerk Meesters wrote: My bad, I did read from the beginning but I think certain parts ended in a void ;) Still, in my opinion any function that takes name/value pairs is a candidate for array overloading. I sometimes wished php would do java'ish method

Re: [PHPTAL] Collecting translation messages from templates

2010-11-04 Thread Kornel Lesiński
On 04-11-2010 at 02:52:06 Per Bernhardt p...@webfactory.de wrote: When using gettext within php, tools like poedit are able to parse the php source code to generate a list of all messages that have to be translated. Is there anything similar for phptal and it's i18n features? There is a

Re: [PHPTAL] Custom modifiers - any callback function

2010-11-03 Thread Kornel Lesiński
On 03-11-2010 at 07:46:29 Anton Andriyevskyy x.meg...@gmail.com wrote: http://phptal.org/manual/en/split/custom-modifiers.html Hey, lets add to PHPTAL a way to use standard php callbacks to define custom modifiers. Currently it is so: phptal_tales_mymodifier It would be nice to use

Re: [PHPTAL] Custom modifiers - any callback function

2010-11-03 Thread Kornel Lesiński
On 03-11-2010 at 12:26:14 Anton Andriyevskyy x.meg...@gmail.com wrote: Thanks for hinting to that method. Actually it can be just right way to follow fully-OOP framework like Kohana. Please don't do it. OOP just for sake of OOP is pointless. but... PHPTAL_TalesRegistry::getInstance() as

[PHPTAL] DocBook killer

2010-10-25 Thread Kornel Lesiński
Does anyone have reason for keeping documentation in DocBook format? It's getting on my nerves — xmlto, tool used to generate PHPTAL documentation, is pain to install (triggers avalanche of dependencies), and DocBook markup is inflexible and verbose at the same time. I'd prefer to write

Re: [PHPTAL] DocBook killer

2010-10-25 Thread Kornel Lesiński
On 25 Oct 2010, at 11:47, Anton Andriyevskyy wrote: Kornel, I remember that I have not finished translation to Russian, the problem partially is because there are no useful tools for DocBook. Maybe with Markdown we will go faster? Or it's not related to site translation at all? There are

Re: [PHPTAL] PHPTAL 1.2.2 Released

2010-10-25 Thread Kornel Lesiński
On 25-10-2010 at 17:21:03 Piotr Kroczyński piotr.kroczyn...@gmail.com wrote: I was wondering if bug described by me in this message http://comments.gmane.org/gmane.comp.php.phptal.general/1447 was fixed? I've searched in changelogs but found nothing about it. No, this one is in

[PHPTAL] PHPTAL 1.2.2 Released

2010-10-24 Thread Kornel Lesiński
I've finally managed to get PHPTAL 1.2.2 out of the door. I've deliberately kept changes to minimum, so if you've been using beta, it's safe to upgrade. The new cool toy in this release is HTML whitespace compressor. Just add this to your sites: $phptal-addPreFilter(new

Re: [PHPTAL] Re: Does PHPTAL supports or tolerate Microdata?

2010-10-14 Thread Kornel Lesiński
On 13-10-2010 at 18:00:12 micheal hosema...@poczta.onet.pl wrote: Thanx. what about RDFa? Does PHPTAL tolerates it? Yes. And SVG, MathML and all other XML vocabularies are supposed to work with PHPTAL. You have to remember to declare XML namespaces for your prefixes (as XML spec

Re: [PHPTAL] Re: Does PHPTAL supports or tolerate Microdata?

2010-10-14 Thread Kornel Lesiński
Microformats and Microdata are easier to use. Yea, but let's assume that for me the result,SEO is pri ority(not learning curve). I've read that RDFa has more support and more options. Whouldn't it be more SEO efficient? IMHO RDFa's advantages are still only in a semantic web fantasy

Re: [PHPTAL] PreFilter - filterDOM

2010-10-14 Thread Kornel Lesiński
On 14 Oct 2010, at 17:08, Levi Stanley wrote: I am migrating over to using PreFilter and using the DOM to manipulate the html document. However, am trying to figure out the usefulness of the method, filterDOM(). I have my DOM, and I am walking threw it and making my changes, however, after

Re: [PHPTAL] Does PHPTAL supports or tolerate Microdata?

2010-10-11 Thread Kornel Lesiński
On 08-10-2010 at 21:06:54 hosema...@poczta.onet.pl wrote: I am planning to integrate some semanticweb technology. Does PHPTAL supports or tolerate Microdata? http://www.google.com/support/webmasters/bin/answer.py?answer=146862 It tolerates it. Note that Google's examples use HTML syntax,

Re: [PHPTAL] Re: AW: Logical operators in PHPTAL

2010-10-04 Thread Kornel Lesiński
On 1 Oct 2010, at 18:46, Moritz Baumann wrote: I think the next step would be to work out syntax exactly: http://phptal.org/wiki/doku.php/improvedtales Hm, that page mentions a lot more than just logical operators. I guess that’s what the negative feedback was about, not logical

Re: [PHPTAL] optional attribute, based on another condition

2010-09-30 Thread Kornel Lesiński
On 30 Sep 2010, at 10:01, Ionut Matei wrote: Hello, I want the 'href' attribute to be skipped if $item['route'] is empty: a tal:content=php:tm._(item['title']) tal:attributes=href php:ro.gen(item['route'])/ the manual says attributes can be skipped with | nothing, but this is based

Re: [PHPTAL] Why PHPTAL stop rendering doctype after clone.

2010-09-30 Thread Kornel Lesiński
So when using HTML5 mode in PHPTAL I need to wrap all values in quotes but in output I get them without quotes. Isn't it additional work for parser to remove quotes even when they are permitted in HTML5? PHPTAL has HTML5 *output* mode. Input is always XML (I haven't gotten around to

Re: AW: [PHPTAL] Logical operators in PHPTAL

2010-09-30 Thread Kornel Lesiński
On 30-09-2010 at 15:45:46 Per Bernhardt p...@webfactory.de wrote: I would love to see this feature, too! Was it no positive feedback or no feedback at all? http://lists.motion-twin.com/pipermail/phptal/2009-November/001967.html Do you think it is hard to implement? It requires writing a

Re: [PHPTAL] Why PHPTAL stop rendering doctype after clone.

2010-09-30 Thread Kornel Lesiński
On 30 Sep 2010, at 18:28, Piotr Kroczyński wrote: Ok thank you for reply. I have just one more question. In which revision is that diry quick fix that you wrote earlier to make PHPTAL write doctype after clone? I just added this to svn:externals in place of 1.2.1: r993 phptal -r 939

Re: [PHPTAL] Logical operators in PHPTAL

2010-09-29 Thread Kornel Lesiński
On 29 Sep 2010, at 06:33, romtek wrote: I'd like to be able to use a bit more simple logic in my templates. Being able to use AND, OR, and NOT would be good. E.g. tal:condition=event/featured AND event/upcoming, tal:condition=NOT event/featured AND event/upcoming I remember there was

Re: [PHPTAL] Next stable release

2010-09-20 Thread Kornel Lesiński
On 18-09-2010 at 18:33:59 Per Bernhardt p...@webfactory.de wrote: is there a planed date for the next stable release of phptal? Because of some important bugfixes (e.g. slot inheritance), we use the current beta in our production environment. Now we have to launch a project at our customers

Re: [PHPTAL] PHPTAL and JQUERY tmpl

2010-09-17 Thread Kornel Lesiński
On 17 Sep 2010, at 18:46, hosema...@poczta.onet.pl wrote: Maybe it is time to lobby for PHPTAL syntax for JQUERY tmpl? John Resig (author of Jquery) are planning to integrate some template functionality inside JQuery core.

Re: [PHPTAL] Translate field

2010-09-15 Thread Kornel Lesiński
On 15-09-2010 at 13:04:09 GRolf ger...@pictureparking.com wrote: I have records in a table that have a status field, which contains a status in 'code' (i.e. NEW, PENDING, APPROVED, ...). There is no conversion table for the moment When outputting this, I'd like to convert this status code

Re: [PHPTAL] Hello, and PHPTAL probelm with UTF-8

2010-08-31 Thread Kornel Lesiński
On 31-08-2010 at 10:54:11 Robert Partyka bob...@wdg.pl wrote: I notice today strange problem with PHPTAL, when I start to use nederlands national characters in template. I get such error: Exception thrown while processing template From /var/www/test-nt/deny/files/index-main.html around line

Re: [PHPTAL] Hello, and PHPTAL probelm with UTF-8

2010-08-31 Thread Kornel Lesiński
On 31-08-2010 at 16:06:29 Robert Partyka bob...@wdg.pl wrote: W dniu 2010-08-31 13:07, Robert Partyka pisze: Now will need to find differences in conf Ok... it looks like mbstring.func_overload = 7 is destroying work of PHPTAL. That's very destructive setting in general. I recommend

Re: [PHPTAL] SourceResolver path in nested macro

2010-08-06 Thread Kornel Lesiński
On 05-08-2010 at 20:44:45 Bas Kooij kooy...@hotmail.com wrote: My current templates looks like this: FILE main.xhtml: html metal:define-macro=main tal:block metal:define-slot=page / /html FILE home.xhtml: tal:block metal:use-macro=main.xhtml/main tal:block metal:fill-slot=page

Re: [PHPTAL] How to use repeat as while

2010-07-30 Thread Kornel Lesiński
On 29-07-2010 at 20:47:05 Klederson Bueno kleder...@klederson.com wrote: Tks for everything, now up and running: class BurnModelIterator implements Iterator { protected $obj, $current; public function __construct(PhpBURN_Core $obj) { $this-obj = $obj; You shouldn't use $obj

Re: [PHPTAL] How to use repeat as while

2010-07-29 Thread Kornel Lesiński
On 29-07-2010 at 16:09:52 Klederson Bueno kleder...@klederson.com wrote: I have this framework ( www.phpburn.com ) and while i do: $obj-fetch() it returns true or false until while ends... however repeat works more as a foreach and then i cant use this... how can i work with repeat working

Re: [PHPTAL] Accessing namespaces from templates

2010-07-08 Thread Kornel Lesiński
On 08-07-2010 at 13:50:27 Thomas D. whist...@googlemail.com wrote: which will end in a ...unexpected T_NS_SEPARATOR... error. So how do we do that? Isn't that currently possible, because PHPTal hasn't got namespace support? Do we need to use the experimental PHPTal version with explicit

Re: [PHPTAL] Re: Accessing namespaces from templates

2010-07-08 Thread Kornel Lesiński
On 08-07-2010 at 15:24:01 Thomas D. whist...@googlemail.com wrote: I wrote: I upgraded PHPTal to v1.2.2b3 and it's working right now. Uhm, I got confused. I didn't saw that b4 is the current beta. http://phptal.org/download.html is still listing b3 and the latest news, which contains a

Re: [PHPTAL] Re: Insert TAL variables into TAL variable

2010-07-06 Thread Kornel Lesiński
On 30-06-2010 at 17:42:17 Bas kooy...@hotmail.com wrote: It doesn't work without the cache attribute, in fact that was the reason I tried using the cache attribute. I tried putting a span inside the tal:block with the define macro and set the cache on the span, but that didn't make a

Re: [PHPTAL] Re: Insert TAL variables into TAL variable

2010-06-30 Thread Kornel Lesiński
On 30-06-2010 at 17:15:30 Bas kooy...@hotmail.com wrote: Thanks for the quick reply. I didn't change the template code, only the variables. In this case I guess phptal:cache= is to blame. Does it work without it? Try putting tal:block phptal:cache= on its own (either inside the macro, or

Re: [PHPTAL] Variables not found while filling slot

2010-06-25 Thread Kornel Lesiński
On 24-06-2010 at 18:55:31 Per Bernhardt p...@webfactory.de wrote: taken the following macro and macro-usage: tal:block metal:define-macro=ul ul li tal:repeat=item items tal:block metal:define-slot=li / /li /ul /tal:block

Re: [PHPTAL] Slots - the second...

2010-06-25 Thread Kornel Lesiński
On 25-06-2010 at 09:57:12 Per Bernhardt p...@webfactory.de wrote: Thanks. That's a great example. I've turned it into a test case - and it passes in the SVN version, but it may be just because the test is short. There's optimisation that turns large slot fills into callbacks to save memory

Re: AW: [PHPTAL] Slots - the second...

2010-06-25 Thread Kornel Lesiński
On 25-06-2010 at 11:57:12 Per Bernhardt p...@webfactory.de wrote: For me it is exactly the other way around :) When I return true in PHPTAL_Php_Attribute_METAL_FillSlot::shouldUseCallback(), my actual template works fine! Returning false (and so disabling the optimisation) breaks the

Re: [PHPTAL] callback?

2010-06-18 Thread Kornel Lesiński
On 18-06-2010 at 14:46:13 GRolf ger...@pictureparking.com wrote: let's say I have a query that will fetch employees from a table. every row has a field department_id. when looping through this array in my template, is there a way to call a callback function that will fetch the department's

Re: [PHPTAL] phptal.org vanished

2010-06-14 Thread Kornel Lesiński
On 13-06-2010 at 04:40:45 s...@prrbl.org wrote: Is this normal ? We can not reach phptal.org anymore. Not normal, but it's fixed now. I've had to move to another DNS server, and I've messed up some config in the process. -- regards, Kornel ___

[PHPTAL] PHP5 DOM prefilters

2010-06-14 Thread Kornel Lesiński
I've realized that exposing PHPTAL's DOM in prefilters wasn't the best idea - it's too basic to be useful. So I've added PHPTAL_PreFilter::filterElement() method, which receives PHP5's native DOMElement to work on. This allows you to use full DOM, XPath, XSLT etc. in prefilters. Even

Re: [PHPTAL] Spelling mistakes in the manual

2010-06-03 Thread Kornel Lesiński
On 30-05-2010 at 12:40:33 Alex a...@xplodinghead.org wrote: I've found a few spelling mistakes in the manual. English is not my fist language and I'm not sure if this is the right place to mention it but here I am ;) Thanks. They're fixed now. -- regards, Kornel

Re: [PHPTAL] require_once vs autoloading

2010-06-02 Thread Kornel Lesiński
On 02-06-2010 at 05:10:07 Tjerk Meesters tjerk.meest...@gmail.com wrote: I could be wrong here, but I think it's not so much any problem with require_once as it is to reduce memory consumption while using the library. This happens when developers only use 30% of the library and yet the whole

Re: [PHPTAL] require_once vs autoloading

2010-06-02 Thread Kornel Lesiński
On 02-06-2010 at 09:56:23 Robert Goldsmith rgoldsm...@names.co.uk wrote: I think autoloading is a good idea but please keep in mind that the app the phptal is being used within may already have autoloading configured. a prime example would be Zend. I've used spl_autoload_register(). Does

Re: [PHPTAL] require_once vs autoloading

2010-06-02 Thread Kornel Lesiński
On 02-06-2010 at 10:33:00 Robert Goldsmith rgoldsm...@names.co.uk wrote: No idea :) However, if you allowed for autoloading to be optional then if needed people could turn it off and replace it with an external system such as Zend's. Maybe moving the autoloader into its own file and

Re: [PHPTAL] require_once vs autoloading

2010-06-02 Thread Kornel Lesiński
On 02-06-2010 at 10:58:41 Tjerk Meesters tjerk.meest...@gmail.com wrote: Zend uses spl_autoload_register() as well I believe, so that should be safe. The main problem I can see is that if there's an existing __autoload() function, spl_autoload_register() will replace it (as stated in the

Re: [PHPTAL] require_once vs autoloading

2010-06-02 Thread Kornel Lesiński
On 02-06-2010 at 11:10:43 Robert Goldsmith rgoldsm...@names.co.uk wrote: Why would someone choose to replace PHPTAL's autoload with something else? (I'm not implying it's perfect or such, just wondering what problem would such option solve). If people already have autoloader code and wish

Re: [PHPTAL] meta tal:content=.../ not working - expected behaviour?

2010-05-05 Thread Kornel Lesiński
On 05-05-2010 at 10:20:28 Marco Pivetta ocram...@gmail.com wrote: So I'm forced to set XML only, right? By default PHPTAL works in XHTML mode, and in this mode meta (as well as br, link, etc.) gets special handling and is always empty. If you're generating non-XHTML XML, then set PHPTAL

Re: [PHPTAL] metal slots and repeats in metal macros

2010-05-05 Thread Kornel Lesiński
On 05-05-2010 at 14:26:08 Robert Goldsmith rgoldsm...@names.co.uk wrote: Just a quick one. Could someone tell me how to reference a variable defined within a metal macro from within a slot? You can't. Slots aren't filled on demand, but in advance before the macro is called (slot in a loop

Re: [PHPTAL] Does stripComments() work?

2010-03-23 Thread Kornel Lesiński
On 22-03-2010 at 20:03:18 romtek rom...@gmail.com wrote: Here's a message I get: PHPTAL Exception: Could not load class PreFilter_StripComments for prefilter 'strip_comments' in: C:\Users\[name]\Documents\Dev\Web\Sites\project\3rdpartybackendlibs\phptal\PHPTAL\. Load class before execution of

Re: [PHPTAL] Duplcate/repeated macros

2010-03-07 Thread Kornel Lesiński
On 07.03.2010, at 15:44, Rowan @ Jetboy wrote: A very simple example. If I have a macro with a slot: div metal:define-macro=page div metal:define-slot=slot/div /div and another macro: div metal:define-macro=box div tal:content=heading/div /div

Re: [PHPTAL] Conditional slot containing element/s

2010-03-07 Thread Kornel Lesiński
On 07.03.2010, at 18:42, Rowan @ Jetboy wrote: If I have a containing 'wrapper' element to a slot definition: div class=wrapper tal:block metal:define-slot=content / /div how can I show or hide 'wrapper' dependent on whether the slot's filled? Slot filled:

Re: [PHPTAL] nested cache bug

2010-03-04 Thread Kornel Lesiński
On 04-03-2010 at 13:45:44 Ivo Võsa i...@insert.ee wrote: Hello, with markup like this div phptal:cache=1m per string: 1 1 div phptal:cache=1h per string: 2 2 /div /div i'm getting following results: request 1: div 1 div 2 /div /div request 2: div 1 div 1 div 2 /div /div /div request 3:

[PHPTAL] Experimental version with PHP 5.3 namespaces

2010-01-27 Thread Kornel Lesiński
Little background story: PHPTAL has been accepted as PEAR package, but PEAR requires change of class names from PHPTAL_* to HTML_Template_PHPTAL_*, which would break all existing code for IMHO not a good enough reason. Therefore I've decided that if I'm having to break existing code, at

Re: [PHPTAL] macros in external files

2010-01-15 Thread Kornel Lesiński
On 15-01-2010 at 16:07:45 Peter Niederlag pe...@niederlag.de wrote: I want to explore the possibilities of macros. Using a metal:define-macro INSIDE my template works as expected. However I fail to use a macro defined in another file. Trying to access the same macro from another template by

Re: [PHPTAL] Is this a typo?

2010-01-07 Thread Kornel Lesiński
On 07-01-2010 at 05:53:30 Wallace McGee wall...@petrosys.com.au wrote: Hi guys, I just got an error msg and saw this apparent typo: _executeMacroOfTempalte eg: \Temp\tpl_4b457551_myobSummary_xhtml__NFgTOiFviwyk0yIkOTzxWg.php(251): PHPTAL-_executeMacroOfTempalte('../common/xhtml...',

Re: [PHPTAL] i18n plural forms

2010-01-07 Thread Kornel Lesiński
On 06-01-2010 at 21:13:55 Marcin Głowacki panglowa...@gmail.com wrote: How to use gettext plural forms in PO file? I've added suitable header (Plural-Forms: nplurals=2; plural=n != 1;\n - for english) and tried in different ways: msgid picture msgid_plural pictures msgstr[0] picture

Re: [PHPTAL] while loop in PHPTAL

2009-12-31 Thread Kornel Lesiński
On 31-12-2009 at 04:44:34 romtek rom...@gmail.com wrote: Thank you very much for this sample! It's much more elegant, easier to understand and maintain than what I've come up with. Things like this had better be published in a special section of documentation. And I hope that array_chunk()

Re: [PHPTAL] while loop in PHPTAL

2009-12-30 Thread Kornel Lesiński
On 29-12-2009 at 22:06:13 romtek rom...@gmail.com wrote: I was looking for a more elegant way to generate grids using PHPTAL that what I've been using and stumbled upon this post: http://lists.motion-twin.com/pipermail/phptal/2007-February/000730.html. In it, Aaron McClimont has proposed

Re: [PHPTAL] Support for PHP 5.3 closures

2009-12-24 Thread Kornel Lesiński
On 23-12-2009 at 22:16:25 Iván Montes drsl...@pollinimini.net wrote: Ok, I see. Certainly native properties access are faster than using the magic __get() method, although I would guess that for the kind of loops in templating logic, the difference would be totally negligible. Yes, it

Re: [PHPTAL] PHPTAL PEAR news

2009-12-21 Thread Kornel Lesiński
On 20-12-2009 at 23:46:11 Daniel Trebbien dtrebb...@gmail.com wrote: Would you like bug reports to be posted to the new pear package site, or do you want to continue receiving them through the mailing list? I think PEAR bug tracker should work already, and I prefer that. However, if you're

Re: [PHPTAL] PHP newline consumption

2009-12-10 Thread Kornel Lesiński
On 10-12-2009 at 03:18:56 romtek rom...@gmail.com wrote: This would also be useful for generating plain text email. People, please! Stop wasting your time with PHPTAL and plaintext! It's deliberately *not* supported. http://phptal.org/wiki/doku.php/plaintext -- regards, Kornel

Re: [PHPTAL] Re: PHP newline consumption

2009-12-10 Thread Kornel Lesiński
On 09-12-2009 at 23:06:40 Richard Cernava cern...@gmail.com wrote: I hate to bring this back up, but this does not seem to be fixed. I'm running PHPTal 1.2.2a1. inside function prepare() I added the preg_replace underneath $result = $this-parse(); to fix it for now. $result =

  1   2   3   >