Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Search found 5 matches
Smarty Forum Index
Author Message
  Topic: [2.6.27] With or without block/compiler end tag possible?
rudiedirkx

Replies: 3
Views: 9928

PostForum: Plugins   Posted: Sat Dec 22, 2012 4:16 pm   Subject: [2.6.27] With or without block/compiler end tag possible?
Even better. Only for custom compilers.

No changes to Smarty::_get_plugin_filepath.

Add below $end_tag in Smarty_Compiler::_compile_compiler_tag:

$tag_command = ltrim($tag_command, '/' ...
  Topic: [2.6.27] With or without block/compiler end tag possible?
rudiedirkx

Replies: 3
Views: 9928

PostForum: Plugins   Posted: Sat Dec 22, 2012 4:09 pm   Subject: [2.6.27] With or without block/compiler end tag possible?
Nope. Scratch that. Making $name in Smarty::_get_plugin_filepath by-reference is a baaad idea.
  Topic: [2.6.27] With or without block/compiler end tag possible?
rudiedirkx

Replies: 3
Views: 9928

PostForum: Plugins   Posted: Sat Dec 22, 2012 3:59 pm   Subject: [2.6.27] With or without block/compiler end tag possible?
I can add dynamic compile blocks to Smarty with only 3 small adjustments (or 'hacks'):

Change Smarty::_get_plugin_filepath:

function _get_plugin_filepath($type, &$name)
{
...
  Topic: [2.6.27] With or without block/compiler end tag possible?
rudiedirkx

Replies: 3
Views: 9928

PostForum: Plugins   Posted: Sat Dec 22, 2012 3:14 pm   Subject: [2.6.27] With or without block/compiler end tag possible?
Maybe what I want is a custom block compiler? Like foreach and if. Not once, but with end tag (sometimes).

I have a function that's a block sometimes and a function other times, depending on tag at ...
  Topic: The Exceptions that are used
rudiedirkx

Replies: 2
Views: 5205

PostForum: Smarty 3   Posted: Thu Aug 12, 2010 11:33 am   Subject: The Exceptions that are used
Could you please change
throw new Exception
to
throw new SmartyCompilerException
(or something like that).
I like to keep my Exceptions separated.
 
Page 1 of 1
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP