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 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: and change the function accordingly, which isn't really that bad, but I

[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 no

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

2012-06-12 Thread Kornel Lesiński
HTML5 output mode PHPTAL still is supposed to parse input as XML. As long as TAL claims to be XML-based language I think it should follow XML rule and require namespace declarations. Ignoring of namespace declarations would be appropriate if PHPTAL had HTML5 *input* mode (parse

Re: [PHPTAL] PHP5.4 compatibility

2012-06-06 Thread Kornel Lesiński
arset 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] Variables in i18n:attributes

2012-05-17 Thread Kornel Lesiński
On Wed, 16 May 2012 17:04:07 +0100, Thomas Tanghus wrote: - We use PHP arrays for translations (don't ask me why), so using the ${var} notation gives undefined variable errors. Use: $translation['foo'] = 'Text ${var}' or $translation['foo'] =

Re: [PHPTAL] Bug when popping context

2012-05-09 Thread Kornel Lesiński
g 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-twi

Re: [PHPTAL] Custom namespaces

2012-04-16 Thread Kornel Lesiński
isn't most elegant indeed. I think you can safely execute PHPTAL_Dom_Defs::getInstance()->registerNamespace() at any time before PHPTAL class compiles the template. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion

Re: [PHPTAL] How about Composer?

2012-04-12 Thread Kornel Lesiński
On Wed, 11 Apr 2012 23:56:08 +0100, Marco Pivetta wrote: Registration on packagist is still up to kornel as he has access to the administration for the repository. Or at least he should setup the callback Added. -- regards, Kornel Lesiński

Re: [PHPTAL] How about Composer?

2012-04-11 Thread Kornel Lesiński
On Wed, 11 Apr 2012 14:05:14 +0100, Hisateru Tanaka wrote: I was surprised but happier than that. Can I merge that pull request? If it's so, who should register to Packagist? Done: http://packagist.org/packages/phptal/phptal -- regards, Kornel Les

Re: [PHPTAL] How about Composer?

2012-04-11 Thread Kornel Lesiński
On Tue, 10 Apr 2012 23:49:34 +0100, Hisateru Tanaka wrote: Looks good to me. I will show this PR to my friends much experienced about Composer than me. Thanks guys. I've added you as collaborators on GitHub. -- regards, Kornel Les

Re: [PHPTAL] How about Composer?

2012-04-10 Thread Kornel Lesiński
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
'm 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
On Tue, 27 Mar 2012 19:58:42 +0100, Marco Pivetta 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://lists.m

Re: [PHPTAL] ZTal 1.3.0

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

Re: [PHPTAL] Escape PHP tags '' on HTML Comments

2012-02-01 Thread Kornel Lesiński
to change -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/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
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 list P

Re: [PHPTAL] Cleaning cache files

2011-10-06 Thread Kornel Lesiński
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/mailma

Re: [PHPTAL] tal:condition question

2011-09-23 Thread Kornel Lesiński
(I presume "idiffer" misspelling is only in the e-mail). Otherwise you can test for existence with: tal:condition="exists:tmp/${offers/idoffer}" If you want to toggle between two icons: .... .... -- regards, Kornel Lesiński

Re: [PHPTAL] Escaping ${} and $

2011-09-02 Thread Kornel Lesiński
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/m

Re: [PHPTAL] Escaping ${} and $

2011-09-01 Thread Kornel Lesiński
On 1 wrz 2011, at 14:56, Tarjei Huse 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. -- regards, Kornel _

Re: [PHPTAL] Any updates to translation tools?

2011-08-23 Thread Kornel Lesiński
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@lists

Re: [PHPTAL] Any updates to translation tools?

2011-08-19 Thread Kornel Lesiński
assume 'yes') Does it need to be scriptable? (again, I assume 'yes') Yes, one-time thing. Notes and warnings need to be preserved (I suppose Markdown doesn't have anything better than inline HTML for this). -- regards, Kornel Lesiński

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 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, dumping informati

Re: [PHPTAL] Proposal: Auto-fill slots with #ids

2011-08-19 Thread Kornel Lesiński
orried that addition of such feature could break existing templates. Hopefully, this isn't too hard to implement with prefilters, so you can have this feature for your templates, if you wish. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/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 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 chapters or so). I see ph

Re: [PHPTAL] Google +1 Button

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

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

2011-07-15 Thread Kornel Lesiński
rite 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] tal:attributes and checkboxes

2011-07-15 Thread Kornel Lesiński
so if you get 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 mailin

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

2011-06-28 Thread Kornel Lesiński
't change anything if you have decided to implement __isset 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 _

Re: [PHPTAL] i18n:domain Attribute

2011-06-28 Thread Kornel Lesiński
slation service, you can 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
n, it's up to you to implement __isset() correctly so that it doesn't happen. PHPTAL doesn't stop you from doing that. -- 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 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 Lesiński

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

2011-06-27 Thread Kornel Lesiński
you expect it to be set anyway. 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] "setting slots in any context"

2011-06-21 Thread Kornel Lesiński
workaround for issue tested in MetalSlotTest::testPreservesContext(). The problem is that tal:define creates new context for its variables, which causes slots to be filled in a wrong context. I've changed (in SVN) the workaround to fill only one level up instead of on top level. --

Re: [PHPTAL] Extending namespace

2011-06-11 Thread Kornel Lesiński
. 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
uild 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@l

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. -- regard

Re: [PHPTAL] Usage of __toString magic method

2011-06-05 Thread Kornel Lesiński
how I extended the phptal_tostring() and phptal_escape() functions to implement this workaround (3 small changes): http://pastie.org/2022716 Thanks. You bring very good point about implicit cast in implode(). I'll fix that one. -- regards, Kornel Lesiński

Re: [PHPTAL] Unit Tests

2011-06-02 Thread Kornel Lesiński
party application 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
urred Exception information: Message: Unable to find variable 'login or email' in current scope i18n:translate takes expression, just like tal:content would (this is to allow translation of dynamically generated text). Use: -- regards, Kornel Lesiński _

Re: [PHPTAL] PHPTAL and Google Website Optimizer

2011-05-27 Thread Kornel Lesiński
On Fri, 27 May 2011 22:09:37 +0100, Jason Pollentier wrote: I'm trying to get Google Website Optimizer working on my site using PHPTAL, and I ran into a couple of big problems. I'm hoping somebody else has already figured this out or can point out some solutions I'm missing. 1) Google wants

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

2011-05-11 Thread Kornel Lesiński
"; namespace. That should work and setAttributeNS will be a little prettier than new DOM_Attr: $wrapper = new PHPTAL_Dom_Element("translation","",array(), $child->getXmlnsState()); $wrapper->setAttributeNS('http://xml.zope.org/namespaces/tal', 'a

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

2011-05-11 Thread Kornel Lesiński
oth macro and context of fill-slot have variable with same name, which one "wins"? -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal

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

2011-05-07 Thread Kornel Lesiński
(oops, I've pressed send accidentally :) Sooo, replace these: + with: + Basically use another macro instead of a slot. -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/ma

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

2011-05-07 Thread Kornel Lesiński
include a call to peopleGet in all php/zpt pages. Slots "see" variables from context (file) they are run in, not from context where the macro is defined. Instead of: you could use: and -- regards, Kornel Lesiński ___ PHPTAL ma

Re: [PHPTAL] new tag

2011-04-23 Thread Kornel Lesiński
to create TALES prefix: function phptal_tales_include($expr, $nothrow) { return 'file_get_contents("your_directory/".'.phptal_tale($expr,$nothrow).')'; } -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-t

Re: [PHPTAL] PHPTAL and ZTal

2011-04-14 Thread Kornel Lesiński
On Thu, 14 Apr 2011 13:42:55 +0100, Robert Goldsmith 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 provide a lot of conveni

Re: [PHPTAL] tal:equal ?!

2011-04-13 Thread Kornel Lesiński
some good content here You could have method like isActivePremier() [or whatever name better describes state you're checking for] and use it like this: If the condition is related to your business rules, then I think that's the most appropriate way to do it. -- rega

Re: [PHPTAL] Template Expressions and Functions

2011-03-25 Thread Kornel Lesiński
On Fri, 25 Mar 2011 07:34:51 -, Anton Andriyevskyy wrote: Great feedback! *1. IF-THEN-ELSE*. That's a tough one. I see two issues: 1. I can't figure out XML-friendly syntax that works well for if/else and especially if/else-if/else 2. There's beauty in TAL's purely functional design

Re: [PHPTAL] macros with optional translation

2011-02-15 Thread Kornel Lesiński
do people think? Dummy translator is the way to go. In terms of overhead, there's possible optimisation that could be added to PHPTAL: translate constant strings during compilation of template, and cache template per language. -- regards, Kornel Lesiński

Re: [PHPTAL] spaces before and after translation keys

2011-02-14 Thread Kornel Lesiński
ZTal :) TAL way is XML way, and XML way is to trim and normalize whitespace. I think trimming makes sense unless you're translating site from Pythonian ;) -- regards, Kornel Lesiński ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com htt

Re: [PHPTAL] translate ...

2011-02-13 Thread Kornel Lesiński
27;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] translate ...

2011-02-13 Thread Kornel Lesiński
On Sun, 13 Feb 2011 17:03:50 -, GRolf 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 for PHPTal templates? I gu

Re: [PHPTAL] Wiki Down

2011-02-01 Thread Kornel Lesiński
On Mon, 31 Jan 2011 15:51:51 -, Miquel 'Fire' Burns wrote: It appears as though the wiki is down. I was just on the site trying to see what changes I needed to allow upgrading to the newest version for an app I made. Ooops. It's now fixed. Sorry for the delay! -- regards, porneL _

Re: [PHPTAL] PHPTAL strange behaviour - bug or feature?

2011-01-25 Thread Kornel Lesiński
tion. Or did I overlooked something in documentation? ; separates attributes in tal:attribute: tal:attribute="href someurl; title sometext" Use ;; if you want the ; character. -- regards, Kornel Lesiński ___ 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

2011-01-13 Thread Kornel Lesiński
prefixes across files, so don't hold your breath for it. -- regards, Kornel Lesiński ___ 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

2011-01-13 Thread Kornel Lesiński
enforcing XML strictness. It's sometimes annoying, OTOH it's a bit dishonest to call TAL an XML language when it doesn't play by XML rules. -- 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.

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 > o

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

2010-11-22 Thread Kornel Lesiński
>> I'm not sure what you mean. If you're trying to output property in PHPTAL, >> then it has to be read anyway. >> > it won't get loaded if doctrine thinks it is allready loaded because __isset > told so. > i think it will be to much work to patch doctrine - and yes Doctrine 2, which > is tota

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

2010-11-22 Thread Kornel Lesiński
On 22 Nov 2010, at 14:00, Ivo Võsa wrote: > Kornel Lesiński wrote: >> That breaks behavior expected of PHP properties. If $obj->foo is supposed to >> have non-NULL value, then isset($obj->foo) shouldn't be returning false. >> >> I consider that a Doctri

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

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 th

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

2010-11-22 Thread Kornel Lesiński
>> $template = new PHPTAL($this->_viewDir . DS . $fileName); >> $template->set($this->_viewVars); > > Another thing that IMHO should be considered is that PHPTAL should > implement ArrayAccess so you could do > $template['menu'] = $menu; > > Would a patch for this be accepted? Sorry, no. That wo

Re: [PHPTAL] Public repository for PHPTAL custom expression modifiers

2010-11-17 Thread Kornel Lesiński
On 17 Nov 2010, at 10:59, Anton Andriyevskyy wrote: > ... or maybe github? How would that work? Code hosted on github is a good idea, but I presume the repository needs to have some presence on phptal.org pages, so there's one obvious place to find them all. -- regards, Kornel

Re: [PHPTAL] Public repository for PHPTAL custom expression modifiers

2010-11-17 Thread Kornel Lesiński
On 16-11-2010 at 19:36:31 romtek wrote: Do you think it can spread people little more if you will make public repository to store & share PHPTAL custom expression modifiers? I like this idea. I like it too. Would you implement it? Or maybe Wiki is enough? -- regards, Kornel _

Re: [PHPTAL] runtime generated slot names

2010-11-10 Thread Kornel Lesiński
On 08-11-2010 at 14:05:36 Robert Goldsmith wrote: The experience of the end user hides all of this and they would just do something like: This set of preferences control when and how we contact you when we need to. OK, that looks like a

Re: [PHPTAL] runtime generated slot names

2010-11-08 Thread Kornel Lesiński
On 08-11-2010 at 11:53:55 Robert Goldsmith wrote: Hi all, I'd like to create a macro with fillable slots but I'd like the names of these slots to be based on variable information passed to the macro. It appears at the moment that the content of a 'define-slot=""' is not processed like ot

Re: [PHPTAL] Collecting translation messages from templates

2010-11-04 Thread Kornel Lesiński
On 04-11-2010 at 02:52:06 Per Bernhardt 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 tool for this in S

Re: [PHPTAL] Custom modifiers - any callback function

2010-11-03 Thread Kornel Lesiński
On 03-11-2010 at 12:26:14 Anton Andriyevskyy 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 I understand it wi

Re: [PHPTAL] Custom modifiers - any callback function

2010-11-03 Thread Kornel Lesiński
On 03-11-2010 at 07:46:29 Anton Andriyevskyy 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 something like this:

Re: [PHPTAL] implode()

2010-10-29 Thread Kornel Lesiński
On 29-10-2010 at 08:23:42 GRolf wrote: I often find myself using tal:repeat to implode an array in php $myarr = array('one', 'two', 'three'); is easily converted to one, two, three with implode(', ',$myarr); But in PHPTal, this is quite cumbersome ${val}, Isn't there an easier soluti

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 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 trickiest part of PHPTAL, so I didn

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 a

[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 documen

[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 PHPTAL_PreFilter_Com

Re: [PHPTAL] PreFilter - filterDOM

2010-10-15 Thread Kornel Lesiński
On 14 Oct 2010, at 19:13, Levi Stanley wrote: > $node->setValueEscaped($url); Unfortunately PHPTAL's DOM isn't quite like W3C DOM and doesn't support setting value on Elements. You'll need to create a text node in there: > foreach($node->childNodes as $n) { > $node->removeChild($n); > } > $

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, a

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 f

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 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 requires). I am new to semantic

Re: [PHPTAL] Multiple calls to use-macro and default slot

2010-10-12 Thread Kornel Lesiński
On 12 Oct 2010, at 11:08, Bicou wrote: > When calling metal:use-macro multiple times, default slots don't get > reinitialized. I've tested version in SVN and it passes test you've sent. Can you verify? svn co https://svn.motion-twin.com/phptal/trunk phptal -- regards, Kornel ___

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

2010-10-11 Thread Kornel Lesiński
On 08-10-2010 at 21:06:54 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, but PHPTAL templates ar

Re: [PHPTAL] Generating multiple values for the class attribute dynamically

2010-10-04 Thread Kornel Lesiński
On 2 Oct 2010, at 07:15, romtek wrote: > Hi, > > I sometimes need to use multiple values for the class attribute but can't > seem to find a way to do this in PHPTAL if those values are to be determined > at run-time. For example, > > ... > I also need to set an additional class value, say: >

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] callback?

2010-10-01 Thread Kornel Lesiński
On 1 Oct 2010, at 09:37, GRolf wrote: > and how can I solve this if I want to use it in my tal:repeat? > > > e.g. for a Client, who has (potentially) multiple "invoices" > > > ${client/name} > ${invoice} tal:condition="not:repeat/invoice/end">, > > > > this works fine if I retrieve all invo

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 h

Re: AW: [PHPTAL] Logical operators in PHPTAL

2010-09-30 Thread Kornel Lesiński
On 30-09-2010 at 15:45:46 Per Bernhardt 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 mini compiler with p

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 writ

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: > > > > the manual says attributes can be skipped with " | nothing", but this > is based on the attribute's value. With php: modifier NULL also works: tal:attribut

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

2010-09-30 Thread Kornel Lesiński
On 29-09-2010 at 21:28:52 Piotr Kroczyński wrote: They say that values with space or special chars must be quotes around. They don't say that quotes should be ommited everywhere else. Just mine interpretation :) Can you send me test case where PHPTAL omits quotes when it shouldn't? -- r

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 t

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

2010-09-29 Thread Kornel Lesiński
On 27 Sep 2010, at 22:22, Piotr Kroczyński wrote: > > After clone PHPTAL stripped doctype... Why ? Thanks for the test case — it was very helpful. Short story: it's a bug. Long story: PHPTAL stores template state in nested PHPTAL_Context objects (tal:define, tal:repeat, macro calls, etc. crea

Re: [PHPTAL] A counterpart of true: modifier

2010-09-27 Thread Kornel Lesiński
On 26-09-2010 at 20:42:46 romtek wrote: Hi, PHPTAL offers PHPTALES modifier true: (equivalent of !empty()). I find it very useful. I would really like to have its opposite. Perhaps, false:. But I think that not: should be an equivalent of empty(). This would allow us not to have to check fo

Re: [PHPTAL] Next stable release

2010-09-20 Thread Kornel Lesiński
On 18-09-2010 at 18:33:59 Per Bernhardt 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 site and he is a bit

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. > http://forum.jquery.com/topic/jquery-templates-proposal#14737

Re: [PHPTAL] Translate field

2010-09-15 Thread Kornel Lesiński
On 15-09-2010 at 13:04:09 GRolf 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 to some more huma

Re: [PHPTAL] Re: Doctype removed with HTML5 output

2010-09-10 Thread Kornel Lesiński
On 9 Sep 2010, at 22:24, Bas wrote: > Ok, thanks. I use it for sending a newsletter, but I would > be better off using XHTML rendering mode then? Either mode should "work" as far as HTML in email clients "works" (PHPTAL's XHTML mode is backwards-compatible with text/html parsing). In case of

Re: [PHPTAL] Doctype removed with HTML5 output

2010-09-09 Thread Kornel Lesiński
On 09-09-2010 at 17:43:23 Bas Kooij wrote: If I set the ouput mode to PHPTAL::HTML5 the doctype gets corrupted. I have the doctype set to: If I remember correctly, this DOCTYPE triggers quirksmode (emulation of IE5 CSS bugs) — you shouldn't use it. which PHPTAL rewrites to: If I s

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 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 against using i

  1   2   3   4   5   >