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

2010-10-05 Thread romtek
It seems to me that some people here believe that introduction of logical
operators to PHPTAL will force them (the people) to use these operators. It
will not. It will simply give more flexibility to those who want it, and
those who don't will be able to continue using PHPTAL the way they have.

By the way, I see no practical way to have templates without logic unless
they are very simple templates (in a simple application).
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


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

2010-10-04 Thread Ivo Võsa

aaatoja wrote:

xxx

or



  
i have used it to and sometimes it is quite handy. only down side is 
that you must remember to change "/" into "."


TEST will give error
TEST will work
TEST will work to

can somebody tell me why is change of separator necessary in frst place?

that aside, i do not think that logic expressions are any way "more 
evil" than using helpers that way.

so +1 to implementing AND and OR.

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


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

2010-10-04 Thread aaatoja
How did I solve the problem? (I'm working with ZF)

/**
 * PHPTAL context modifier (helper:)
 *
 * @param string $src
 * @param boolean $nothrow
 * @return string
 */
function phptal_tales_helper($src, $nothrow) {
  $src = 'helper->'.trim($src);
  return PHPTAL_Php_Transformer::transform($src, '$ctx->');
}

$view->addHelperPath($moduleDir.'/views/helpers', $moduleName.'_View_Helper');

And now I can use inside my templates:
xxx

or




___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal