Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
The logic is that I'm doing many checks and want set or not set products variable - does not matter it is object or array. I just wanted to write less code by making PHPTAL template more flexible. So I'll not be worried to always setup and initialize products object. Anton On Sat, May 31, 2008 at

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread anru chen
how about check path first tal:conditions = "exists: product/notEmpty" then use tal:replace or tal:contents to output actully product? so you can push that "and" logic into your business model rather that wirte it in a view model regards On Sat, May 31, 2008 at 10:17 AM, Anton Andrievskij <[E

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
The aim is to avoid setting always products. On Sat, May 31, 2008 at 12:03 AM, Christoph Frick <[EMAIL PROTECTED]> wrote: > On Fri, May 30, 2008 at 07:04:47PM +0300, Anton Andrievskij wrote: > > > How can I specify multiple conditions using AND logical operator and php: > > for one of the parts?

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Christoph Frick
On Fri, May 30, 2008 at 07:04:47PM +0300, Anton Andrievskij wrote: > How can I specify multiple conditions using AND logical operator and php: > for one of the parts? > > I'm trying this but does not works: > > tal:condition="exists: products AND php:count(products) == 0" in python an empty lis

Re: [PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Iván -DrSlump- Montes
Sure I don't mind to share, it's just that I've been way to busy with other projects and in its current state is not usable. I was in the middle of a huge refactoring when I stopped working on it. The repository is at: http://svn.pollinimini.net/drtal/trunk And generated documentation at: http:

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Christian Welzel
Am Freitag 30 Mai 2008 schrieb Kornel Lesinski: > php:isset(var) is equivalent to exists:var (but not in more complex case > of exists:var/prop - then you're out of luck ;) php:isset(var['prop']) works fine in this case. -- MfG, Christian Welzel GPG-Key: http://www.camlann.de/key.asc

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 17:59:58 +0100, Anton Andrievskij <[EMAIL PROTECTED]> wrote: PHPTAL rewrites code in php: expressions to use TAL variables, so it will work fine. Please can you explain a bit more about this? How it works? There's a simple PHP parser that modifies the code (see Php/Tr

Re: [PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 17:28:18 +0100, Iván -DrSlump- Montes <[EMAIL PROTECTED]> wrote: I've been trying to push for PHPTAL use in several projects in the last years but I haven't been very successful. I ended up writing my own version from scratch a couple of months ago, leveraging new PHP 5.3 f

Re: [PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Anton Andrievskij
I think it is better to get new developers with new programming logic to use PHPTAL. Then you will have more strong and professional community. Smarty must go to the syncope together with its old-type programmers. As for me - I never used Smarty because I found it ugly and stupid the first time I

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
>>> PHPTAL rewrites code in php: expressions to use TAL variables, so it will work fine. Please can you explain a bit more about this? How it works? On Fri, May 30, 2008 at 7:47 PM, Kornel Lesinski <[EMAIL PROTECTED]> wrote: > On Fri, 30 May 2008 17:36:34 +0100, Anton Andrievskij <[EMAIL PROTECT

Re: [PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 15:29:10 +0100, Patrick Burke <[EMAIL PROTECTED]> wrote: I'm seeing PHPTAL at a tipping point. I wasn't able to get PHPTAL into many environments in the last couple years because big, fat, ugly Smarty was sitting in the templates directories already. Perhaps writing Smar

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 17:36:34 +0100, Anton Andrievskij <[EMAIL PROTECTED]> wrote: 1. But then php will check if real "products" variable exists but not tal-object's product property? PHPTAL rewrites code in php: expressions to use TAL variables, so it will work fine. php:isset(var) is equ

Re: [PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Anton Andrievskij
I agree about 'marketing friendly' too. PHPTAL guys, lets improve on this part. I'll help doing my best for this task. Anton On Fri, May 30, 2008 at 7:28 PM, Iván -DrSlump- Montes < [EMAIL PROTECTED]> wrote: > I've been trying to push for PHPTAL use in several projects in the > last years but I

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
1. But then php will check if real "products" variable exists but not tal-object's product property? 2. Why it is bad idea to have some logical operands in PHPTAL then? Thanks for your answer on my problem. Anton On Fri, May 30, 2008 at 7:22 PM, Kornel Lesinski <[EMAIL PROTECTED]> wrote: > On F

Re: [PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Iván -DrSlump- Montes
I've been trying to push for PHPTAL use in several projects in the last years but I haven't been very successful. I ended up writing my own version from scratch a couple of months ago, leveraging new PHP 5.3 features and the bundled XML parsers + Tidy for legacy templates. The main point in implem

Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 17:04:47 +0100, Anton Andrievskij <[EMAIL PROTECTED]> wrote: How can I specify multiple conditions using AND logical operator and php: for one of the parts? I'm trying this but does not works: tal:condition="exists: products AND php:count(products) == 0" TALES doesn't h

[PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
Hi, guys. How can I specify multiple conditions using AND logical operator and php: for one of the parts? I'm trying this but does not works: tal:condition="exists: products AND php:count(products) == 0" Thanks, Anton ___ PHPTAL mailing list PHPTAL@li

[PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Patrick Burke
nterprise features that make it more known about to higher >> level Development leads. It's true though. >> >> Hew >> >> On Fri, May 30, 2008 at 6:00 AM, <[EMAIL PROTECTED]> >> wrote: >> > Send PHPTAL mailing list submissions to >> >

Re: [PHPTAL] Lower than as char in javascript

2008-05-30 Thread Christian Welzel
Am Freitag 30 Mai 2008 schrieb Kornel Lesinski: > p_speed = ${php:json_encode(plane_speeds)} Thanks for your hint to json_encode(). I didn't know this function as i normally try to avoid javascripting (and use jquery)... I reorganised my code and got rid of most of the js code in the template. No

Re: [PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Anton Andrievskij
Patrick, are you developer of PHPTAL or not? Anton On Fri, May 30, 2008 at 5:29 PM, Patrick Burke <[EMAIL PROTECTED]> wrote: > I love PHPTAL, and the self documentation thread going on is a very > interesting idea. The requirement that brought up self-documentation > seems like a development en

[PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Patrick Burke
I love PHPTAL, and the self documentation thread going on is a very interesting idea. The requirement that brought up self-documentation seems like a development environment issue though, The development environment issue seems odd to me because I would think that the core variables needed would

Re: [PHPTAL] problem with proteced function

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 13:20:38 +0100, anru chen <[EMAIL PROTECTED]> wrote: zend framework has a Zend_Config class, in that class, __isset is a protected function. so if i am pass a Zend_Config object to PHPTal, and try to do some thing like here PHP throws this error: Fatal error: Call to pr

[PHPTAL] problem with proteced function

2008-05-30 Thread anru chen
Hi : I have searched achieves , but did not find any topics related to this problem. I am use zend framework, PHPTal as my template engine. function phptal_path($base, $path, $nothrow=false) in class PHPTAL_Context uses "method_exists" to check if a method exists in a object or not. for example

Re: [PHPTAL] Lower than as char in javascript

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 11:12:04 +0100, Christian Welzel <[EMAIL PROTECTED]> wrote: Is your JavaScript is between a CDATA block ? This does not work, because we want to use some phptal stuff in the js code section to generate parts of the code. As soon as i add CDATA, i get errors like this one:

Re: [PHPTAL] Lower than as char in javascript

2008-05-30 Thread Christian Welzel
Guillaume Lecanu schrieb: Is your JavaScript is between a CDATA block ? This does not work, because we want to use some phptal stuff in the js code section to generate parts of the code. As soon as i add CDATA, i get errors like this one: "Unable to find path plane" An example of our js code

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Kornel Lesinski
On Fri, 30 May 2008 10:19:18 +0100, Iván -DrSlump- Montes <[EMAIL PROTECTED]> wrote: With something like this the comment won't show up any element can have tal:comment attribute. and it's possible to register your own attribute or namespace in PHPTAL, so you could have -- regards

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Guillaume Lecanu
Le vendredi 30 mai 2008 à 11:19 +0200, Iván -DrSlump- Montes a écrit : > Guillaume, > > With something like this the comment won't show up > > Ok, why not. > Anyway, PHPTAL has a pre/post filtering callback which can be used to > remove the comments if needed. May be it's possible to includ

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Anton Andrievskij
You are right, we can use PHPTAL::setPreFilter(), but with something built in it will be very useful. I always wanted to make some documentation on templates. Anton On Fri, May 30, 2008 at 12:23 PM, Iván -DrSlump- Montes < [EMAIL PROTECTED]> wrote: > The problem with having PHPTAL generate the d

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Iván -DrSlump- Montes
The problem with having PHPTAL generate the documentation is that some templates might not be used often, for example one for a obscure feature of the site, so the documentation might not be uptodate. If you think this is what you actually need, you can use PHPTAL::setPreFilter() to register a cal

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Iván -DrSlump- Montes
Guillaume, With something like this the comment won't show up Anyway, PHPTAL has a pre/post filtering callback which can be used to remove the comments if needed. Iván On Fri, May 30, 2008 at 11:03 AM, Guillaume Lecanu <[EMAIL PROTECTED]> wrote: > Le jeudi 29 mai 2008 à 22:14 +0200, Iván -DrS

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Anton Andrievskij
No I think the right idea is to have this documentation in XML format directly inside template and to have PHP tal to output this documentation. So why not to allow PHPTAL to output this documentation just like it outputs other contents? Then developers may have access to the documentation to alway

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Kornel Lesinski
On Thu, 29 May 2008 20:25:51 +0100, Jason - USL <[EMAIL PROTECTED]> wrote: For example, if my template designer creates something like tal:repeat="option options", my php developer would see a corresponding line in the documentation saying that the variable 'options' needs to be set, and it ne

Re: [PHPTAL] automated documentation for templates?

2008-05-30 Thread Guillaume Lecanu
Le jeudi 29 mai 2008 à 22:14 +0200, Iván -DrSlump- Montes a écrit : > NaturalDocs [1] is a very flexible documentation system which can be > configured to suit almost any language [2]. > > The documentation could look something like this: > > > http://www.naturaldocs.org > [2] http://www.natura

Re: [PHPTAL] Lower than as char in javascript

2008-05-30 Thread Guillaume Lecanu
Le jeudi 29 mai 2008 à 22:55 +0200, Christian Welzel a écrit : > Hi there, > > is there a way to insert a lower than in phptal, which is printed as lower > than in the source code? > My problem: i have a javascript part in my template where i need a lower > than in some cases ... ( if(foo < 0) {

Re: [PHPTAL] Lower than as char in javascript

2008-05-30 Thread Kornel Lesinski
On Thu, 29 May 2008 21:55:11 +0100, Christian Welzel <[EMAIL PROTECTED]> wrote: is there a way to insert a lower than in phptal, which is printed as lower than in the source code? In this case PHPTAL does what XHTML requires and escapes '<' as '<'. This is perfectly OK and works in browse