Hi,
While putting my localization strings in place I discovered an interesting
quirk that perhaps someone could explain.
This is my construct:
foo bar
The idea is that a page can override the default page title by setting the
title variable. If not specified, the page title should be translated
Hi,
Small typo, should be 'escape' instead of 'exscape' ;)
On Sep 3, 2011 3:06 AM, "Kornel Lesiński" wrote:
> On Fri, 02 Sep 2011 09:59:51 +0100, 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
Hi guys,
Wrote this modifier to solve a small inconvenience with conditional
blocks; this time I had five different blocks and I didn't feel like
passing five variables to control them.
Hope it's useful to you guys ;-)
The syntax:
"eq:" [ " " expr ]*
These are some examples:
eq: data/value str
On Tue, Jun 28, 2011 at 2:52 PM, Ivo Võsa wrote:
> Kornel Lesiński wrote:
>>
>> I think it's illogical or buggy. You're saying it's not set, but then you
>> expect it to be set anyway.
>>
>>
>> If you have lazily-loaded properties, then you should simply return *true*
>> from __isset() for such pr
On Mon, Jun 27, 2011 at 6:36 AM, Terin Stock wrote:
> I've been working with PHPTAL for quite some time, and have always been
> annoyed that from within the template an object's __get method was being
> ignored. I think I've tracked down the bug (in version 1.2.2, though it
> still present in trun
Why not just have tal:content="nl2br: var"
Just define phptal_tales_nl2br() and voila :)
On Jun 10, 2011 12:03 PM, "Hisateru Tanaka"
wrote:
> Hi,
>
> I'm trying to extend namespace of PHPTAL to use in my framework.
> 3 new attributes would introduced.
>
> pal:content-nl2br
> pal:replace-nl2br
> p
Hi,
Try to move the cache folder instead, file uploads in /tmp with .php
extension could be associated with security breaches in forum/wp sites.
On May 15, 2011 8:41 AM, "Marco Afonso" wrote:
> Hi all,
>
> I'm new to PHPTAL and I'm loving it!
>
> Although, at the same time I started using it on
For the and operation I've written a modifier that turns all its arguments
into an array of booleans and then uses array_mult() to determine the
outcome for tal:condition.
array_sum could be used for the or-operation ;)
On Apr 14, 2011 2:27 AM, "Kornel Lesiński" wrote:
> On Wed, 13 Apr 2011 14:45
On Jan 14, 2011 1:17 AM, "Kornel Lesiński" wrote:
>
> On Thu, 13 Jan 2011 10:22:52 -, Tjerk Meesters <
tjerk.meest...@gmail.com> wrote:
>
>> Here's the problem; it throw an error, saying that the myns namespace
>> is not defined ... is that expected?
Hi,
Just bumped into something similar.
I'm using a so-called skeleton.html (a big macro starting with
and defining multiple slots for scripts, styles, content, popups,
etc.).
Let's say that I define xmlns:myns="http://example.org/myns"; in the
of my skeleton.html and then one of my slots gets
Hi,
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
overloading ... is there another reason beyond the one-up comp
Alternatively you could allow overloading set() to accept an array as its
only argument.
On Nov 22, 2010 8:40 PM, "Anton Andriyevskyy" wrote:
> Separate method is good idea, but the name *setAll *may be confusing,
> you may think that it will replace the ones that you have set earlier with
> set()
Interestingly, that's what I ran into yesterday. Found out that while one
version of phptal hides any content inside the empty condition, another
(probably older) version would instead show it, causing a rather
embarrassing few minutes ;)
On Nov 4, 2010 4:49 PM, "Per Bernhardt" wrote:
> Hey, use
>
2010/6/2 Kornel Lesiński :
> On 02-06-2010 at 11:10:43 Robert Goldsmith 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 autoloa
Hi,
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
manual). I don't think putting the autoloader in a separate file will
make a
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 shebang is loaded on every request ;-)
On Wed, Jun 2, 2010 at 5:20 AM, romtek
can write a prefilter that does what I
> need.
>
> On Fri, Mar 12, 2010 at 3:42 PM, Tjerk Meesters
> wrote:
>>
>> Maybe not via a string but being able to pass attributes using an array
>> with the keys being attribute names would be handy.
>>
>>
>>
Maybe not via a string but being able to pass attributes using an
array with the keys being attribute names would be handy.
On 13-Mar-2010, at 4:12, Christina Van Dyke wrote:
I know you can assign attributes to a tag by doing this: tal:attributes="class string:myclass; id string:myid;">text
Why not just use a client side calendar, such as those provided with
jquery ui?
On 09-Feb-2010, at 19:12, Marco Pivetta wrote:
Didn't think about week days and weeks, sorry ^_^'' (Yeah, stupid
mistake...)
2010/2/9 Kornel Lesinski
On 9 Feb 2010, at 11:00, Marco Pivetta wrote:
> Isn't i
Just out of curiosity, why does this bother you? In (x)html newlines
are at best considered one white-space. Are you using this inside
?
On 12/10/09, Richard Cernava wrote:
>
>> >
>> > A "feature" of PHP's is to consume a newline when it is following
>> > it's closing
>> > tag (http://bugs.php.
Also, errors will be silently ignored by default if you use ${}.
Changing it to tal:content, for instance, without an alternative
(using pipe syntax) would throw a template exception if the used
expression could not be resolved at runtime.
On 12/9/09, Kornel Lesiński wrote:
> On 08-12-2009 at 15:
Hi,
What do you mean by all-whitespace translation keys? I hope that
doesn't mean i18n:translate="" will stop working, because we rely
heavily on this feature ;-)
On 11/23/09, Kornel Lesiński wrote:
> On 22.11.2009, at 20:16, lo...@nic.fi wrote:
>
>> I'v got a problem translating text that is pr
While I was looking at the pager example, I couldn't help but think
this could be fixed by having a few helper classes for this; helper
classes that would make your phptal code cleaner and abstract out
certain typical tasks of a pager.
The same could be said for the dropdown scenario. All in all,
To maintain proper bc I would suggest another namespace, like ntales (new tales)
The problem of modifier scope is difficult, unless you can introduce
syntax like this:
(php:foo()) + foo/bar
Braces around the modifier code would define the scope, but this is
still error prone if you decide to hav
Would it be possible to use a preg_replace() with two expressions, one
to replace $$ by $ and one to handle \b${?(\w+)
2009/11/4 Kornel Lesiński :
> On 03-11-2009 at 17:56:02 Tobias Herp
> wrote:
>
>> Kornel Lesiński wrote:
>>>
>>> I could change it to:
>>>
>>> ${x} → value
>>> $${x} → ${x}
>>>
Then don't serve the stylesheet; at least it shouldn't give an ugly js
alert, wouldn't you agree? :)
Besides, the structure of the pages ain't that complex to begin with;
not sure who would ever use "run-in" in the first place ;-)
On 10/29/09, Kornel Lesiński wrote:
> On 28-10-2009 at 04:27:46 r
I vote for not changing the current behaviour; I agree that if it's
documented, it can be a little weird ;-)
Personally I would choose to have a money formatter TALES construct,
because I hate having to go through my templates again when I start
adding another currency for instance.
Best,
Tjer
Within php: context you should use "option[0]" instead to get the
first element of the option array
On 10/22/09, Kornel Lesiński wrote:
> On 22-10-2009 at 14:09:42 Michael wrote:
>
>> One more thing:
>> My select statement:
>>
>>
>> ${option/1}
>>
>>
>>
>> I have a problem with this statemen
One way is to use the "structure" keyword to prevent escaping of your
already escaped variables.
On 10/13/09, admirau wrote:
> How to disable auto escaping for all variables?
> (I use third party software, which already escapes all the variables).
>
> --
> regards
> takeshin
>
> _
Start your script with
On 9/2/09, GRolf wrote:
> I'm using a to fill my macro template with
> javascript code. However, all < are converted to $lt;, which (seems
> to) cause an error in a for loop
>
> for (i=0; i < myarray.lenght; i++) {
> ...
> }
>
> is converted to
>
> for (i=0; i < myarray.
Hi,
This is because php doesn't support __set() in array context, which is
what phptal uses to define template variables.
It's a bit of a drawback to having to construct a temporary array
first every time, but with php5 it doesn't incur much penalty since it
uses copy-on-write by default ;-)
On
Hmm we've seen this mistake being made a lot ;-) would it help if this
was documented under, like, "things to consider when using php:
modifier"? :)
On 6/18/09, Kornel Lesiński wrote:
> On 18-06-2009 at 15:42:14 Igor Sverkos
> wrote:
>
>> If you don't have an object, just an array - how do I acc
Hi,
What I meant was:
tal:attributes="selected exists: isSelected"
Always try to avoid using php: constructs in your templates ;-)
Bets,
Tjerk
2009/6/16 Kornel Lesiński :
> On 16-06-2009 at 16:16:53 Igor Sverkos
> wrote:
>
>> Hi,
>>
>> Tjerk Meeste
Hi,
As Kornel mentioned, this is fixed in the repos and it can be made to
work for older versions by using "exists: isSelected" instead of
"isSelected | nothing"
Hope that helps :)
On 6/16/09, Igor Sverkos wrote:
> Hi,
>
> Tjerk Meesters wrote:
>> Hmm I
Hmm I don't think using "selected" as the value is the solution to the
exact problem here, because phptal does understand the so called
binary attributes, such as selected and checked.
Seems like the '| nothing' is causing the expression to change type
and display a 1 instead of being treated in a
When doing translations in phptal you can use any backend to load the
translation map (not just gettext) by extending the translationservice
class and pass this to setTranslator(); personally I would load single
translation files inside the useDomain() method and/or setLanguage()
For Javascript I
Not sure where you see 16px, the browser default font size is being used afaik.
The grey top could be reduced though, as well as the menu bar height;
other than that, the reading area is wider which is good and it's
overall cleaner I find ;-)
On Mon, Jun 1, 2009 at 1:27 PM, aaatoja wrote:
> For
That's because you're using the php: construct; try
tal:condition="php: box['nr'] > 5"
Though, usually - wherever I can - i insert the condition inside the
list of elements I'm iterating over, so that I don't have to use php:
Best,
Tjerk
On Sun, May 24, 2009 at 6:13 PM, Dominique Sandoz wrot
lot" without the tal: prefix
3) same for i guess? ;-)
Best,
Tjerk
On Mon, May 18, 2009 at 3:12 PM, Guillaume Lecanu wrote:
> Le dimanche 17 mai 2009 à 20:32 +0800, Tjerk Meesters a écrit :
>
>>
>>> It would be much easier if you could just add tal: and metal: in
Hi,
On Sun, May 17, 2009 at 6:52 PM, wrote:
>> Thanks for this information, do you have created a custom DTD for PHPTAL
> with all the attributes list ?
>> This will be cool if you can share it :-)
>
> I have sent a copy of the custom DTD privately. It merely appends some
> attributes that enabl
It would be much easier if you could just add tal: and metal: inside
the %coreattrs definition ;-)
On Sun, Apr 12, 2009 at 11:16 PM, wrote:
> To follow up my own posting, I've found it's possible to get the W3C
> validator to accept tal: and metal: attributes by using a DOCTYPE that
> points to
Guess the __DIR__ constant came a bit too late then ;-)
On 4/29/09, Kornel Lesiński wrote:
> On 29-04-2009 at 00:53:41 romtek 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
Because "selected" is one of those special attributes in php you can
also just use:
If I'm not mistaken, a boolean value for "active" should work the way
you want it.
On 4/28/09, Julian Haupt wrote:
> Hi,
>
>> The way you USA should work, but try this:
>>
>>
>>
>>
>
> In general it mig
Within php: context the period "." is expanded to "->" afaik, so if
your variable is not an object, try using c['id'] instead of c.id
On 4/28/09, Matt Marron wrote:
> I have been trying to figure out how to get the selected option to properly
> show up in a select list all day with no success. I
Use setSource() of the phptal class to load from a string that you
fetch from your db
On 4/23/09, Jason La wrote:
> Hi,
>
> Is possible to store templates in a database instead of the file
> system, and how would I go about doing that?
>
> Thanks,
> Jason
> ===
> Jason La
> jaso...@gm
I would solve this problem by making paths to javascript, css and
images absolute (i.e. /js/script.js)
This avoids any issues with relative paths in html but also in css
(referring bg images for instance)
On 3/27/09, Daniel Lima wrote:
> Hi,
>
> Yeah, that is ok! But, if my webdesigner uses a w
Hi,
Try item['value'] instead of item.value inside the php: block; the dot
is translated as -> which would be incorrect as your value is an array
element.
On 3/19/09, Daniel Lima wrote:
> Hi,
>
> I have the follow PHP script:
>
> ...
> $datagrid = new Cilens_Grid;
> echo $datagrid.*resultsPerPa
Wouldn't it make more sense to turn your define-slot's into use-macro
instead? ;-)
On 2/6/09, kaaposc wrote:
> Hello!
>
> Is there any way to define slots on the fly? Like this:
>
>
> Currently looks like PHPTAL takes slot name as string without trying to
> parse. And of course PHP complaints a
For this to work, in your forum template, you have to wrap
define-macro=forum around the use-macro=main
On 1/31/09, Szymek Przybył wrote:
> I have website which uses phptal, it is main tempate:
>
>
>
>
> ...
>
> ...
>
>
> And it is some page template:
>
>
>
> This is an expamle
>
>
Hi,
After my recent recompilation of PHP, the logs were showing errors regarding
the reflection classes; however, the documentation never states its
dependency.
Tip: make sure that the ./configure line doesn't include
"--disable-reflection" during PHP installation.
Best,
Jack
Alternatively, the correct controller could be chosen based on the intended
usage. If a repeat block doesn't use the value of "last" this doesn't even
apply. If "last" is being used, pre-fetching may be an option to get the
intended value of count()
Actually this could apply to other functions as
51 matches
Mail list logo