Re: [PHPTAL] Radio Buttons selection box

2008-06-30 Thread Kornel Lesiński
Dnia 29-06-2008 o 05:56:33 Levi Stanley [EMAIL PROTECTED] napisał(a): Or you can do it like the method below, however I was wondering if there is a better way than doing it like this? You could solve it like this: $phptal-best_times_to_call = array('Morning','Evening'); option tal:repeat=opt

Re: [PHPTAL] Avoid intermediate phptal files

2008-07-31 Thread Kornel Lesiński
On 31-07-2008 at 14:18:39 Alejandro Giardino [EMAIL PROTECTED] wrote: I'm using PHPTAL with some forms in a web site. PHPTAL is writing files in /tmp as a usual behavior, but I would need to avoid the files creation It can't be avoided currently. Why do you need to do that? -- regards,

Re: [PHPTAL] Avoid intermediate phptal files

2008-08-01 Thread Kornel Lesiński
On 31-07-2008 at 20:56:42 Werner [EMAIL PROTECTED] wrote: Just another potential pitfall worth mentioning in there, maybe, is the fact that you should be careful when your templates output intermediate files to more than one directory No, it's not a problem. Function name contains MD5 of

Re: [PHPTAL] Variables inside conditional comments not parsed

2008-08-07 Thread Kornel Lesiński
On 07-08-2008 at 13:37:19 Jakub Argasiński [EMAIL PROTECTED] wrote: variables inside !--[if IE]...![endif]-- are not parsed. Indeed, because technically it's a comment. PHPTAL is not IE, so it doesn't interpret magic IE tags. You can hack around it with something like this: tal:block

Re: [PHPTAL] Best way to make a list of list

2008-08-08 Thread Kornel Lesiński
On 08-08-2008 at 17:18:31 Guillaume Lecanu [EMAIL PROTECTED] wrote: But all the structure is stored in DB, so I don't know in advance if one menu have 1, 2, or 10 childrens, and I don't know if a children is a submenu. I know how to do that in PHP without PHPTAL, but how is it possible to do

Re: [PHPTAL] Re: Documentation update?

2008-08-21 Thread Kornel Lesiński
On 20-08-2008 at 15:25:50 romtek [EMAIL PROTECTED] wrote: The manual has been changed recently, but it still doesn't describe some things added recently. I've checked several things that I think would be helpful for new PHPTAL users to know , and none of them are in the manual: - nothing or

Re: [PHPTAL] Error in the manual or bug in phptal?

2008-08-21 Thread Kornel Lesiński
On 21-08-2008 at 10:37:52 tarjei [EMAIL PROTECTED] wrote: When I try the following example: option value=main-twocolumn.html tal:attributes=SELECTED php: menuItem.template == 'main-twocolumn.html' ? 'SELECTED': false Tospalter/option I get: option value=main-twocolumn.html

Re: [PHPTAL] Re: Documentation update?

2008-08-21 Thread Kornel Lesiński
On 21-08-2008 at 12:00:38 tarjei [EMAIL PROTECTED] wrote: If you (or someone else) would like to help with the documentation, the source file is in: https://svn.motion-twin.com/phptal/trunk/doc/en/book.xml Ok, here goes :) Thanks. Actually selected was mentioned later in that section, so

Re: [PHPTAL] cache-refresh triggered by events

2008-08-26 Thread Kornel Lesiński
On 24-08-2008 at 11:01:10 Stefan Riehmer [EMAIL PROTECTED] wrote: i thought i might share my ideas on a special cache, that will be refreshed when a special event is triggered. Refreshing by triggers is pretty complicated. You usually have news in your front-end templates (perhaps even

Re: [PHPTAL] tag directory in subversion repository not updated

2008-08-28 Thread Kornel Lesiński
On 28-08-2008 at 08:09:44 Michał Taszycki [EMAIL PROTECTED] wrote: would it be possible to update https://svn.motion-twin.com/phptal/tags/directory to contain latest releases. It would be convenient for those using svn:externals. Good point. Fixed. -- regards, Kornel

Re: [PHPTAL] A question about translations.

2008-09-08 Thread Kornel Lesiński
On 01-09-2008 at 08:36:54 Tero Heikkinen [EMAIL PROTECTED] wrote: MidCOM 3 uses datamanager - called component to handle form data input. If some form field's validation fails, it re-displays form and puts error messages in place. Generally error messages are generated on the fly. What I

Re: [PHPTAL] Using tal:repeat as condition

2008-09-08 Thread Kornel Lesiński
On 04-09-2008 at 10:12:37 Christoph Frick [EMAIL PROTECTED] wrote: But it causes error Unable to find path number in current scope. Is this possible to make such a condition? I know I could generate in PHP something like item/isThird but I wish to keep my PHP code clean from such hacks. you

Re: [PHPTAL] Conditional class-attribute

2008-09-08 Thread Kornel Lesiński
On 08-09-2008 at 12:27:50 Ernesto Baschny [cron IT] [EMAIL PROTECTED] wrote: I could try some nested ? expressions, but this turns out to be quite ugly, e.g. if I would have more than 2 classes to set You can concatenate strings in php: expressions - just add spaces around ., i.e.:

Re: [PHPTAL] Conditional class-attribute

2008-09-08 Thread Kornel Lesiński
On 08-09-2008 at 14:53:10 Ernesto Baschny [cron IT] [EMAIL PROTECTED] wrote: I could try some nested ? expressions, but this turns out to be quite ugly, e.g. if I would have more than 2 classes to set You can concatenate strings in php: expressions - just add spaces around ., i.e.:

Re: [PHPTAL] syntax iterable objects

2008-09-09 Thread Kornel Lesiński
On 09-09-2008 at 10:57:24 Zbyněk Nevrlý [EMAIL PROTECTED] wrote: Hello, I have question about syntax iterable objects. Here is code: div id=MText tal:condition=php: language == 'cz' tal:repeat=item itemsList tal:content=item/poznamkafoo value/div Well, I want to format value item/poznamka by

Re: [PHPTAL] bug with condition

2008-09-11 Thread Kornel Lesiński
On 11-09-2008 at 04:20:11 zou guangxian [EMAIL PROTECTED] wrote: If the code is: [CODE] div class=blank_bg tal:define=book relative/book tal:condition=php: count(book)0/div [/CODE] will generate [RESULT] ?php $ctx = $tpl-pushContext() ; $ctx-book = phptal_path($ctx-relative, 'book',

Re: [PHPTAL] variable syntax

2008-09-17 Thread Kornel Lesiński
On 17-09-2008 at 14:57:59 Zbyněk Nevrlý [EMAIL PROTECTED] wrote: I have a several question about variables in PHPTAL templates: 1) How to put phptal variable to string. Here is code. I want to get variable nestedItem['m_obrazek'] to property onclick. ${nestedItem['m_obrazek']} You can use

Re: [PHPTAL] multiple pre/post filters

2008-10-03 Thread Kornel Lesiński
On 02-10-2008 at 19:15:47 a b [EMAIL PROTECTED] wrote: How to add two or more post/pre filters to the template? _prefilter is not an array, so just last filter is executed. class MyBunchOfFilters implements PHPTAL_Filter { function filter($code) {

Re: [PHPTAL] Namespace with shorter notatnion

2008-10-06 Thread Kornel Lesiński
On 03-10-2008 at 21:56:04 a b [EMAIL PROTECTED] wrote: How to modify default namespace to have shorter notatnion of: tal:block i18n:translate=my string/tal:block (assuming I do not use i18n:translate=var) for example as: tal:langmy string/tal:lang There's nothing within TAL syntax that can

Re: [PHPTAL] assigned fields

2008-10-08 Thread Kornel Lesiński
On 08-10-2008 at 15:57:51 admi [EMAIL PROTECTED] wrote: This is example code: $t = new Tal(); $t-title = TitleTest; $t-content = ContentText; $t-setTemplate(content.html); $t-execute(); //here $t-content should be unset $t-setTemplate(title.html); $t-execute(); //I'd like to have only

Re: [PHPTAL] php array - TAL path:

2008-10-09 Thread Kornel Lesiński
On 08-10-2008 at 23:57:05 Axel Zöllich [EMAIL PROTECTED] wrote: abc.php: $ergebnis = $mysqli-query(SELECT * FROM farbe); while ($zeile = $ergebnis-fetch_object()) { $typen[farben][][kuerzel] = $zeile-kuerzel; $typen[farben][][bez] = $zeile-bez; } On each loop iteration you're creating two

Re: [PHPTAL] Re: assigned fields

2008-10-10 Thread Kornel Lesiński
On 09-10-2008 at 20:11:22 admi [EMAIL PROTECTED] wrote: I can set it to null if I know it was used in content.html. What if I don't know wchich variables have been used ? content.html uses $t-content, but I'd like to unset $t-content after executing and not knowing that content.html used

Re: [PHPTAL] Preloading a macros file ?

2008-10-10 Thread Kornel Lesiński
On 10-10-2008 at 15:46:10 Guillaume Lecanu [EMAIL PROTECTED] wrote: If PHPTAL read it, I suppose all readed macros will be saved in memory, and so we should uses it everywhere without the need of ${m}; You could try to hack PHPTAL::executeMacro() function - get base function name that your

Re: [PHPTAL] Preloading a macros file ?

2008-10-10 Thread Kornel Lesiński
On 10-10-2008 at 10:25:36 Guillaume Lecanu [EMAIL PROTECTED] wrote: I have a file macros.html with all my macros for our website. But this is really annoying to call each macros like this : metal:use-macro=../../macros.html/name_of_my_macro There is a solution to force to load macros.html and

Re: [PHPTAL] php if else syntax in phptal

2008-10-13 Thread Kornel Lesiński
On 12-10-2008 at 11:21:18 Iván -DrSlump- Montes [EMAIL PROTECTED] wrote: The problem is probably that PHPTAL parser doesn't know how to correctly process the PHP ternary operator. No, it does. table tal:attributes=class php: record/works_page ? 'llista_cancons' : 'llista_canconsindiv'

Re: [PHPTAL] Re: assigned fields

2008-10-13 Thread Kornel Lesiński
On 10-10-2008 at 19:16:36 admi [EMAIL PROTECTED] wrote: If you may tell me where in PHPTAL (in which file) it is read, so I could put some of my code there and unset it automatically while reading :) It's in Context.php → __get() -- regards, Kornel

Re: [PHPTAL] How to disable autoquote ?

2008-10-14 Thread Kornel Lesiński
On 14-10-2008 at 10:53:58 Iván -DrSlump- Montes [EMAIL PROTECTED] wrote: I think that CDATA is special enough as to have its own handler, I mean that it should be equivalent to 'structure'. Since TAL should output XML valid documents, having a way to specify a CDATA section seems logical.

Re: [PHPTAL] How to disable autoquote ?

2008-10-14 Thread Kornel Lesiński
On 14-10-2008 at 10:08:15 Ernesto Baschny [cron IT] [EMAIL PROTECTED] wrote: It would be cool to have a tal:cdata= boolean value, where one could switch on generation of CDATA wrapping automatically, so one could write: script tal:content=structure myJsCode tal:cdata=true/script And doesn't

Re: [PHPTAL] How to disable autoquote ?

2008-10-14 Thread Kornel Lesiński
On 13-10-2008 at 21:22:26 Iván -DrSlump- Montes [EMAIL PROTECTED] wrote: prefix the content with the 'structure' keyword, it will use the value verbatin. script tal:content=structure myJsCode/script This may make XHTML ill-formed if there's any or in the script. script/*![CDATA[*/

Re: [PHPTAL] phptal:debug doesn't works ?

2008-10-14 Thread Kornel Lesiński
On 14-10-2008 at 12:01:27 Guillaume Lecanu [EMAIL PROTECTED] wrote: When there is an error into my code, the error reported by PHPTAL is not really precise. I'm searching a way to tell me which line in my original template file the error is found. What error are you getting? I have tried to

Re: [PHPTAL] phptal:debug doesn't works ? [not ok with macros ?]

2008-10-14 Thread Kornel Lesiński
On 14-10-2008 at 13:01:28 Guillaume Lecanu [EMAIL PROTECTED] wrote: Argh, just tried with macros, and this doesn't report the good line. Technically, I have a /templates/template.html with some of global parts common to every page. Into this template.html, there : div id=content

Re: [PHPTAL] Re: assigned fields

2008-10-14 Thread Kornel Lesiński
On 13-10-2008 at 22:57:29 admi [EMAIL PROTECTED] wrote: Thanks! But.. Context.php - public function __get($varname) { var_dump(Trying to get something!); return huh?; if ($varname == 'repeat') return $this-__repeat; ... } Doesn't display anything

Re: [PHPTAL] Dynamic macros

2008-10-21 Thread Kornel Lesiński
On 21-10-2008 at 07:03:50 Maciej Łebkowski [EMAIL PROTECTED] wrote: I dont know if there are any drawbacks — cache, optimisation, etc? If you've implemented PHPTAL_Source well then cache should work fine as long as code of the macro doesn't change too often. Or maybe I am missing some

[PHPTAL] PHPTAL 1.1.14rc1

2008-10-21 Thread Kornel Lesiński
New version of PHPTAL is available. It's a release candidate, because it has a small backward-incompatible change and I'd like to hear your feedback about it. -- regards, Kornel ___ PHPTAL mailing list PHPTAL@lists.motion-twin.com

Re: [PHPTAL] PHPTAL 1.1.14rc1

2008-10-21 Thread Kornel Lesiński
On 21-10-2008 at 12:01:56 tarjei [EMAIL PROTECTED] wrote: New version of PHPTAL is available. It's a release candidate, because it has a small backward-incompatible change and I'd like to hear your feedback about it. Can you describe the change? Detailed information is on PHPTAL's

Re: [PHPTAL] Dynamic macros

2008-10-21 Thread Kornel Lesiński
On 21-10-2008 at 12:52:02 Maciej Łebkowski [EMAIL PROTECTED] wrote: I don`t think it is possible. ;-) It relies too much on the user input. For example, the content of the page (markdown syntax) can be extended with some data from atom feed. Reading of atom feeds doesn't sound like

Re: [PHPTAL] Error in doc

2008-10-30 Thread Kornel Lesiński
On 30-10-2008 at 16:52:48 Michael Hart [EMAIL PROTECTED] wrote: Should be tal:attributes=class php: repeat.ranking.odd ? 'odd' : NULL Fixed in the English version (translations will get fixed later). Thanks! -- regards, Kornel ___ PHPTAL mailing

Re: [PHPTAL] my own keyword handler

2008-11-04 Thread Kornel Lesiński
On 03-11-2008 at 23:36:55 Christian Welzel [EMAIL PROTECTED] wrote: But phptal_tales() seems not to be the right function as it generates the line as this: Core_Helper_LinkHelper::getInstance()-createUrl('folder',array('goto'=$ctx-'.phptal_path($ctx-ud , 'id').',)) which ends in a parser

Re: [PHPTAL] my own keyword handler

2008-11-05 Thread Kornel Lesiński
On 04-11-2008 at 18:45:10 Christian Welzel [EMAIL PROTECTED] wrote: Now it generates this: Core_Helper_LinkHelper::getInstance()-createUrl('folder',array('goto'=$ctx-{phptal_path($ctx-ud, 'id')},)) what leads to the runtime error: Unable to find path 0 in current scope. 0 is the value of

Re: [PHPTAL] muliple filters, modifiers... new API?

2008-11-06 Thread Kornel Lesiński
On 05-11-2008 at 21:18:11 Krzysztof Suszyński [EMAIL PROTECTED] wrote: Is there a plan to make PHPTAL working with multiple filter/modifier functions with easy interface like for ex.:| You can create derived PHPTAL class that has interface you want with help of method given in FAQ:

Re: [PHPTAL] protecting html templates

2008-11-07 Thread Kornel Lesiński
On 07-11-2008 at 09:56:22 Krzysztof Sikorski [EMAIL PROTECTED] wrote: tal:block omit-tag=?php exit; ?/tal:block Sorry, it should be tal:block omit-tag=1 replace=?php exit; ?/tal:block. BTW: omit-tag is never needed on tal:block, and it's redundant with replace. -- regards, Kornel

Re: [PHPTAL] protecting html templates

2008-11-07 Thread Kornel Lesiński
On 07-11-2008 at 09:38:13 Zbyněk Nevrlý [EMAIL PROTECTED] wrote: Hi, I am using PHPTAL for seperate business logic from presentation. So there are controllers, model classes and views (HTML templates). Problem is there views/*.html are accessible from direct calling through URL (I need to

Re: [PHPTAL] Does stripComments() work?

2008-11-10 Thread Kornel Lesiński
On 10-11-2008 at 08:26:02 romtek [EMAIL PROTECTED] wrote: I just used stripComments(true) on my template object but didn't see any effect. The output still contained HTML comments. Does this method not work or have I misunderstood its purpose? Comments are stripped before template it

Re: [PHPTAL] Does stripComments() work?

2008-11-11 Thread Kornel Lesiński
On 11-11-2008 at 06:27:16 Werner [EMAIL PROTECTED] wrote: Hmmm, this makes me wonder... the first thing that jumps to mind is that one would consider caching a template's meta-/config data together with the template itself, in order to detect configuration / state changes since the last

Re: [PHPTAL] Template lastModified time

2008-11-17 Thread Kornel Lesiński
On 16-11-2008 at 13:01:31 Maciej Łebkowski [EMAIL PROTECTED] wrote: I am doing some content negotiation in my application. In particular, i`m settign LastModified, ETag, etc headers, and checking if content is modified (and returning 304 response if its not). Now I have: $LastModified =

Re: [PHPTAL] ?Bug - setSource doesn't reset the template

2008-11-17 Thread Kornel Lesiński
On 16-11-2008 at 08:24:11 Dave Looker [EMAIL PROTECTED] wrote: I needed to generate several templates all using the same set of data so I populated a single template and then reset the template before each execute. However using setSource() to load a template instead of setTemplate()

Re: [PHPTAL] ?Bug - setSource doesn't reset the template

2008-11-18 Thread Kornel Lesiński
On 18-11-2008 at 06:12:18 romtek [EMAIL PROTECTED] wrote: I'd like to understand the purpose of this method. Is it to initialize a template object with a template in memory, not in file? Yes. What's the path parameter for? For example it's displayed in error messages instead of anonymous

Re: [PHPTAL] ?Bug - setSource doesn't reset the template

2008-11-19 Thread Kornel Lesiński
On 19-11-2008 at 04:31:07 romtek [EMAIL PROTECTED] wrote: Please elaborate on this. Particularly, I don't know what an anonymous string is. Perhaps, a short example would be helpful. If you use $phptal-setSource(perror!), PHPTAL will report that you've got error in string XXX line 1, and

Re: [PHPTAL] omit-tag or ${}?

2008-11-19 Thread Kornel Lesiński
On 19-11-2008 at 10:38:49 Szymek Przybył [EMAIL PROTECTED] wrote: What difference is between replace and content? Replace always replaces entire tag. It's a shortcut for tal:omit-tag and tal:content at once. In my example I want to add after price variable EURO sign. But maybe better

Re: [PHPTAL] signs in content as text

2008-11-20 Thread Kornel Lesiński
On 19-11-2008 at 20:43:49 Szymon Przybył [EMAIL PROTECTED] wrote: And now, when I want to use sings like or in js code, I write: if(countx tal:replace=structure ''/3) ...and you create invalid XHTML. (otherwise xml parsing will return an error) Because literal and are forbidden in

Re: [PHPTAL] Re: signs in content as text

2008-11-20 Thread Kornel Lesiński
On 20-11-2008 at 13:04:30 Szymek Przybył [EMAIL PROTECTED] wrote: And as for the character - it is sometimes used in href of a (in $_GET globals), for example: a href=index.php?site=teamid=2Team 2/a In this case i don't get any error - well this char is ok in href, in phptal templates?

Re: [PHPTAL] Re: signs in content as text

2008-11-20 Thread Kornel Lesiński
On 20-11-2008 at 14:30:57 Szymek Przybył [EMAIL PROTECTED] wrote: But if in main.html there will be: html metal:define-macro=main head script tal:condition=exists:needs_scripts src=.. / /head body metal:define-slot=body/ /html Where could I insert info, that current page is, for example,

Re: [PHPTAL] signs in content as text

2008-11-20 Thread Kornel Lesiński
On 20-11-2008 at 15:23:30 Szymek Przybył [EMAIL PROTECTED] wrote: Is there some way to add automatically /*![CDATA[*/ /*]]*/ on start and end of js scripts? You can write regular expression that does it and hook it up using phptal-setPreFilter(). If you have decent text editor that

Re: [PHPTAL] tree in PHPTAL

2008-12-04 Thread Kornel Lesiński
On 04-12-2008 at 09:34:03 a b [EMAIL PROTECTED] wrote: Below is a sample of how I store and display in PHP tree structure stored in the database. Can anybody tell me how to rewrite this code into PHPTAL? I assume, that I should use macro recurrency, but how to prepare array in such case?

Re: [PHPTAL] Question on string/attribute replacement on text string with embedded hyperlink

2008-12-08 Thread Kornel Lesiński
On 04-12-2008 at 21:24:37 Ian Boersma [EMAIL PROTECTED] wrote: Hi Levi, Here is what I currently have in my .html page for this mixed string: p i18n:translate=focus_on_textCheck out our new a href=/posts/cc_launcher.php tal:attributes=href classroom_corner/href; title classroom_corner/title

Re: [PHPTAL] PHPTAL and Zend Framework

2008-12-10 Thread Kornel Lesiński
Is there any guide step by step guide to integrate PHPTAL with Zend Framework? There's no official guide, as I'm not user of Zend Framework (I'd love if someone contributed such guide!) I have done it extending Zend_View, but this way I do not have access to Zend Helpers. From a quick

Re: [PHPTAL] PHPTAL and Zend Framework

2008-12-15 Thread Kornel Lesiński
But how to get rid of this 'structure' keyword? I wrote a simple pre-filter, to add 'structure' automatically, but this is not most elegant way. Escaping cannot be controlled from within expression modifiers, so a pre-filter isn't bad solution. If you're using pre-filter, I suggest that you

Re: [PHPTAL] tree in PHPTAL

2008-12-16 Thread Kornel Lesiński
On 16-12-2008 at 11:39:48 Nick Pack n...@carbidefinger.net wrote: Sorry to dig up an old thread guys, I've been attempting to use Kornel's code below but am getting an exception when there is not a third dimension array, for example: ul metal:define-macro=recursivelist tal:condition=menu

Re: [PHPTAL] No output, execute only once.

2008-12-18 Thread Kornel Lesiński
On 17-12-2008 at 18:35:04 Miko Väli mikov...@gmail.com wrote: span tal:omit-tag=php:helper.headTitle('Index') / This works, but is being called twice. This is now fixed in SVN version. -- regards, Kornel ___ PHPTAL mailing list

Re: [PHPTAL] Best practices for performance?

2009-01-05 Thread Kornel Lesiński
On 04-01-2009 at 00:05:39 Alister Cameron alister.came...@cameroncreative.com wrote: Can you please shed some light on what are best practices regarding keeping PHPTAL fast? PHPTAL does most of the work at compile time, so after first execution of a template, the overhead is minimal. The

Re: [PHPTAL] Casing with tal:content values question

2009-01-05 Thread Kornel Lesiński
On 03-01-2009 at 14:41:26 Mikael Andersson mail.mi...@gmail.com wrote: It works fine now, just in case someone else runs into similar trouble this is what I've done. 1. set the encoding for the PHPTAL object 2. Added ?xml version=1.0 encoding=ISO-8859-1? 3. Added meta http-equiv=Content-Type

Re: [PHPTAL] Infinite loop with ArrayObject into tal:repeat and Split deprecated

2009-01-06 Thread Kornel Lesiński
On 05-01-2009 at 00:31:35 G. Sobrinho gabriel.sobri...@gmail.com wrote: 1. ArrayObject - http://php.net/array_object The PHPTAL have a problem with ArrayObject. When i try to set a template var with instance of ArrayObject and use tal:repeat, this cause a infinite loop. I couldn't

Re: [PHPTAL] Best practices for performance?

2009-01-06 Thread Kornel Lesiński
On 06-01-2009 at 11:46:58 Alister Cameron alister.came...@cameroncreative.com wrote: Excuse my ignorance, Kornel. Can you elaborate on what you mean by not secure? I use structure a fair bit to return, say, a fully formatted anchor tag. That DOES have the character in it. Sorry, I wasn't

Re: [PHPTAL] Error - but i cant find the reason

2009-01-06 Thread Kornel Lesiński
On 06-01-2009 at 13:24:17 Torsten Hinze info4hide...@gmx.de wrote: Hello, if i call my site PHPTAL return this error: Parse error: syntax error, unexpected ';' in C:\WINNT\Temp\tpl_1231247664_1_1_14navigation9790ed651b9881a5e44194953211b4d9.php on line 12 In the navigation.pt in line 12 i

Re: [PHPTAL] Error - but i cant find the reason

2009-01-06 Thread Kornel Lesiński
On 06-01-2009 at 14:03:05 Torsten Hinze info4hide...@gmx.de wrote: ul class=public tal:define=navItems php: getNavItems($sosContext); li tal:repeat=item navItems Cant you see any error? After i wrote this i have see the error. I have used sosContext with a leading $. This is wrong in PHPTAL.

Re: [PHPTAL] Zend Framework + PHPTAL

2009-01-12 Thread Kornel Lesiński
On 11-01-2009 at 16:59:01 takeshin admi...@gmail.com wrote: I wrote a tutorial on integrating PHPTAL and Zend Framework. Hope it helps. http://taat.pl/article/zend_framework_tutorial/ Thanks. I've linked it on the PHPTAL website. -- regards, Kornel

Re: [PHPTAL] Problem with sample code in documentation

2009-01-19 Thread Kornel Lesiński
On 17-01-2009 at 17:59:04 Karol Sikora ka...@elektrrrus.pl wrote: I tried to use a sample code from documentation (chapter 4.1): div tal:define=welcome random_welcome_message/ div i18n:translate=welcome.../div It throws an exception with message that message is undefinied. I think it should

Re: [PHPTAL] PHPTAL Macros File error template

2009-01-22 Thread Kornel Lesiński
On 22.01.2009, at 21:19, bart josnos wrote: Anyone know why this macros wont work? But my problem is that I keep getting an error like this PHPTAL_Exception' with message 'Macro '' is not defined' Please update PHPTAL to the latest version. I've fixed error that caused this message to

Re: [PHPTAL] pre filters on macros/slots

2009-01-27 Thread Kornel Lesiński
On 26-01-2009 at 17:35:34 admirau admi...@gmail.com wrote: Is there a chance to run PREFilter on macro or slot? In my PreFilter I load $xhtml into PHP DOM and do recursive walking on all text nodes. When I run it as PreFilter on the template with macros/slots nothing happens. The same as

Re: [PHPTAL] default macro file

2009-01-30 Thread Kornel Lesiński
On 30-01-2009 at 03:13:16 romtek rom...@gmail.com wrote: Assuming that unwinding when handling exceptions is more time consuming than using if/else mechanism, wouldn't it be better to build this ability into PHPTAL? Yes, exceptions are slower, but it doesn't make noticeable difference

Re: [PHPTAL] default macro file

2009-02-10 Thread Kornel Lesiński
On 30.01.2009, at 18:09, romtek wrote: On Fri, Jan 30, 2009 at 4:57 AM, Kornel Lesiński kor...@aardvarkmedia.co.uk wrote: On 30-01-2009 at 03:13:16 romtek rom...@gmail.com wrote: Assuming that unwinding when handling exceptions is more time consuming than using if/else mechanism, wouldn't

Re: [PHPTAL] Macro in macro?

2009-02-10 Thread Kornel Lesiński
And in php: $tal=new PHPTAL('inc/main.html'); $tal-setTemplate('pages/forum.html'); $tal-setTemplate('pages/forum/main.html'); And it doesn't work - there is only forum, without inc/main template :/ What I done wrong? You can't set more than one template at a time. Call to setTemplate()

Re: [PHPTAL] Security bug in PHPTAL?

2009-02-12 Thread Kornel Lesiński
On 12-02-2009 at 14:23:37 Szymek Przybył apocalyp...@gmail.com wrote: exception 'PHPTAL_Exception' with message 'Invalid element name 'ohhe.length;qhxk+=3){ifdm+=rkfg(ohhe.substr'' in /inc/PHPTAL-1.1.14/PHPTAL/Dom/Node.php:107 Stack trace: # etc... Code has been injected into your template

Re: [PHPTAL] Prefilter fails

2009-02-19 Thread Kornel Lesiński
On 19-02-2009 at 16:28:35 php...@jakeman.plus.com wrote: Added that and PHP no longer dies. But I still can't get the Prefilter to change the output even if I totally replace the source using: ?php require_once 'PHPTAL.php'; require_once 'PHPTAL/Filter.php'; class MyPreFilter implements

Re: [PHPTAL] Re: [multi dimension array] problem with repeat

2009-02-23 Thread Kornel Lesiński
On 23.02.2009, at 17:40, Majkel wrote: I want to get a key of item and than use it it the loop as index of different arrays. When you loop examplevariable (as in tal:repeat=examplevariable examplearray), then expression: repeat/examplevariable/key or php:repeat.examplevariable.key

Re: [PHPTAL] Re: Process dynamically inserted content (feature request?)

2009-02-27 Thread Kornel Lesiński
On 27-02-2009 at 16:17:37 Moritz Baumann flamin...@online.de wrote: skeleton.html: html metal:define-macro=skeleton tal:block metal:define-slot=header / tal:block metal:define-slot=content / /html another file: $phptal-setSource('tal:block metal:use-macro=skeleton.html/skeleton div

Re: [PHPTAL] Repeat scope issue

2009-02-28 Thread Kornel Lesiński
On 28.02.2009, at 00:41, Richard Cernava wrote: I've noticed that PHPTal places the repeat value variable in the ctx object, which happens to be the same scope as all others assigned to view. [...] I'm not sure if this is a bug or not considering standard php practice is to make these

Re: [PHPTAL] Disabling PHP?

2009-03-03 Thread Kornel Lesiński
On 03-03-2009 at 00:34:53 Alister Cameron alister.came...@cameroncreative.com wrote: Because I'm using PHPTAL in a WordPress theme, I want to disable PHP except for some very basic logic operations. Has anyone done this, and if so, how? Is there some elegant and simple way to control which

Re: [PHPTAL] Multilevel list menu - must done in recursion, can be done in phptal?

2009-03-03 Thread Kornel Lesiński
On 03-03-2009 at 12:58:02 Szymek Przybył apocalyp...@gmail.com wrote: I have on page multilevel list menu. Please read FAQ entry titled Output trees recursively (e.g. nested multi-level menus) http://phptal.motion-twin.com/faq.html#q-trees -- regards, Kornel

Re: [PHPTAL] Alternate table row coloring with custom modifier

2009-03-05 Thread Kornel Lesiński
On 05-03-2009 at 10:15:52 Mr Brightside scors...@epf.pl wrote: Hello, I'm trying to apply some css classes to alternate rows in my table. According to the PHPTAL manual, you can use this: tal:attributes=class php: repeat.ranking.odd ? 'odd' : NULL It works fine, but there's a better way

Re: [PHPTAL] How to compare numbers with equal character

2009-03-13 Thread Kornel Lesiński
On 13.03.2009, at 21:11, majkel wrote: 1. How to compare numbers with equal character. I found : LT (less than) : GT (greater than) = : LE (less or equal) = : GE (greater or equal) Where is = ? so I can use it like this: span tal:condition=php: val.type EE 253 ? == works. Alternative

Re: [PHPTAL] Cache dir where

2009-03-13 Thread Kornel Lesiński
On 13.03.2009, at 21:13, majkel wrote: Where can I set a dir where cache files are stored? By default it's in your system's temp directory. You can change it using PHPTAL-setPhpCodeDestination() method. -- regards, Kornel ___ PHPTAL mailing

Re: [PHPTAL] problem with passing object to template

2009-03-16 Thread Kornel Lesiński
On 13-03-2009 at 20:17:53 majkel hosema...@poczta.onet.pl wrote: As we can see almost everywhere I have to use t prefix ${t/classname} in variable. […] How can I get rid of t prefix($tpl-t) and access directly ex: ${classname}? In PHP you could assign all $t's properties as variables:

Re: [PHPTAL] Extension of templates - html or xml?

2009-03-30 Thread Kornel Lesiński
On 29-03-2009 at 14:31:02 Levi Stanley l...@eneservices.com wrote: Better? Naming conventions are just that naming conventions, as long as you can keep it consistent the better. However, if you want to argue, I think it would be better to use the extention .xhtml. But that isn't just me who

Re: [PHPTAL] Re: Missing semicolon and constants for variable keys

2009-04-05 Thread Kornel Lesiński
On 04.04.2009, at 22:25, Bobby wrote: I want to eventually make an error list macro, my errors are sent to the template under a constant key name, for example: interface AppConstants { const ERROR_KEY = 'error_key'; } $template = new PHPTAL('example.html');

Re: [PHPTAL] Missing semicolon and constants for variable keys

2009-04-05 Thread Kornel Lesiński
On 04.04.2009, at 03:15, Bobby wrote: Hello, I'm new to PHPTal and i've run into a few issues... They're fixed now :) Please test: http://phptal.motion-twin.com/files/PHPTAL-1.2.0a5.tar.gz -- regards, Kornel ___ PHPTAL mailing list

Re: [PHPTAL] FAQ - recursive array tree

2009-04-15 Thread Kornel Lesiński
On 15-04-2009 at 12:16:53 Urša Baričević uba...@gmail.com wrote: Hello, I have structure like this: array( 'gallery', 'gallery/category, 'gallery/category/subcategory1', 'gallery/category/subcategory2', 'gallery/category2/subcategory1', ); How to convert this

Re: [PHPTAL] right side expression evaluated using left side variable in tal:define

2009-04-16 Thread Kornel Lesiński
On 16-04-2009 at 07:07:10 Ciprian Vieru devel@gmail.com wrote: It looks like tal:block tal:define=label preferences/label|label tal:replace=structure label/ result in a null value for variable label if preferences/label is not defined, even if label is defined. Indeed. This is now

Re: [PHPTAL] Zend Framework from integration with PHPTAL tutorial - how add new pages?

2009-04-22 Thread Kornel Lesiński
On 22-04-2009 at 14:04:38 Szymek Przybył apocalyp...@gmail.com wrote: *Fatal error*: Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in /home/szymon/domains/

Re: [PHPTAL] Re: Zend Framework from integration with PHPTAL tutorial - how add new pages?

2009-04-22 Thread Kornel Lesiński
On 22-04-2009 at 14:59:07 Szymek Przybył apocalyp...@gmail.com wrote: NewsController.php have exacly the same content as IndexController from tutorial. It probably has whitespace or BOM at the beginning, and the issue you're having probably has absolutely nothing to do with Zend or PHPTAL.

Re: [PHPTAL] Template storage in database?

2009-04-23 Thread Kornel Lesiński
On 23-04-2009 at 02:17:50 Jason La jaso...@gmail.com wrote: Is possible to store templates in a database instead of the file system, and how would I go about doing that? You can use PHPTAL-setSource() in current stable release. In version 1.2.0 you can create your own SourceResolver class

Re: [PHPTAL] Problem with PHPTAL::addSourceResolver()

2009-04-23 Thread Kornel Lesiński
On 23-04-2009 at 17:40:42 Michał Wysoczański mic...@wysoczanski.net wrote: There is a little error in PHPTAL::addSourceResolver(). The attached simple patch fixes this. Done. Thanks. -- regards, Kornel ___ PHPTAL mailing list

Re: [PHPTAL] Recommendation for the dynamic definition data encoding in source of template.

2009-04-24 Thread Kornel Lesiński
On 24-04-2009 at 08:19:41 CREATIVE0809 trance_creat...@mail.ru wrote: My site use several locales in the same time. Encoding can differ from user to user. UTF-8 would save you a lot of hassle. That's why i'm wrote this patch. I need simple way to set the encoding during script's execution,

Re: [PHPTAL] Suggestion: PHPTAL modifiers/plugin library?

2009-04-27 Thread Kornel Lesiński
On 26-04-2009 at 18:43:11 Jason La jaso...@gmail.com wrote: Is there a repository or library of modifiers for PHPTAL? There's repository of filters: http://taat.pl/phptal_filter_library/ but there isn't any for modifiers yet. I've see that you can create custom modifiers, and the method

Re: [PHPTAL] PHPTAL 1.2.0 alpha

2009-04-28 Thread Kornel Lesiński
On 27-04-2009 at 16:51:32 Christian Welzel gaw...@camlann.de wrote: Hi there, today i upgraded my test system from 1.1.15 to 1.2-alpha-10 and now im hitting this error: Fatal error: Cannot redeclare class PHPTAL_Tales in /usr/share/php/PHPTAL/TalesRegistry.php on line 23 I'm using the zend

Re: [PHPTAL] PHPTAL 1.2.0 alpha

2009-04-29 Thread Kornel Lesiński
On 29-04-2009 at 00:53:41 romtek rom...@gmail.com wrote: OK, I've given up on require() and changed it all to require_once(). Is there ever a reason to use require() to include code (not text)? I hoped it would be faster than require_once, but it turned out that with relative paths the

Re: [PHPTAL] PHPTAL 1.2.0 alpha

2009-04-30 Thread Kornel Lesiński
On 29-04-2009 at 19:07:27 Tjerk Meesters tjerk.meest...@gmail.com wrote: Guess the __DIR__ constant came a bit too late then ;-) I had PHP_DIR there previously, but that had a mysterious side-effect of slowing down includes in APC. -- regards, Kornel

Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!

2009-05-14 Thread Kornel Lesiński
On 14-05-2009 at 06:34:11 Alister Cameron alister.came...@cameroncreative.com wrote: Could I bother someone to have a look at the processed cache file and diagnose? http://www.alistercameron.com/tal.src.txt This code uses entry variable _after_ the loop (e.g. in id=post-${entry/the_ID}).

Re: [PHPTAL] PHPTAL 1.2.0 alpha - is this a bug or my fail?!

2009-05-14 Thread Kornel Lesiński
It seems that you've used slots where macros would have been more appropriate. This just defines the same slot many times: span tal:repeat=entry entries omit-tag= span metal:define-slot=cfct_excerpt / /span and the code below it, outside the loop: div metal:fill-slot=cfct_excerpt

[PHPTAL] Guillaume

2009-05-18 Thread Kornel Lesiński
Hi Guillaume, I can't send you e-mails privately - your e-mail server doesn't want to talk to mine [82.70.200.180]. Do you have another e-mail address or can I send response to the mailing list? -- regards, Kornel ___ PHPTAL mailing list

  1   2   3   4   >