Re: [SMARTY] {literal}{/literal} and {ldelim}{rdelim}
| From: | messju mohr | Date: | Fri, 18 Apr 2003 13:28:00 +0000 |
| Subject: | Re: [SMARTY] {literal}{/literal} and {ldelim}{rdelim} | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9319@lists.php.net to get a copy of this message | ||
On Fri, Apr 18, 2003 at 02:51:31PM +0200, Kai-Uwe Beyer wrote:
> Matthias Mohr wrote:
>
> >>
>
>
> --------------------------------------------------------------------------------------------------------------
>
> >> require_once( 'Smarty.class.php' );
> >>
> >> $smarty = &new Smarty();
> >> $smarty->left_delimiter = '<{';
> >> $smarty->right_delimiter = '}>';
> >>
>
>
> --------------------------------------------------------------------------------------------------------------
>
> >> Or you make your own Smarty-Class which extends the original one and sets
> >> the delimiters in the constructor.
> >> BTW, I find '<{' and '}>' a good alternative for the
> >> delimiters,
>
> because they don't
>
> >> interfere with javascript, look similar to the original delimiters and
>
> also look like
>
> >> HTML-tags for graphical editors...
>
>
> I have a similar problem. I've downloaded a nice php script (phpMerlin),
> which generates a javascriptmenu like:
[...]
> I want to include this php File my template with "include_php file=",
> but the smarty engine generate only till the var definitions. The rest
> will be ignored :(.
>
> Is there any suggestion to solve this problem?
>
>
> Thanks a lot.
i don't know phpmerlin, but your problem may be, that files
included via include_php are not executed in global context, but in
the context of a method of the $smarty-instance.
that means you have to declare all global vars you want to access as
"global".
i'm pretty sure this does have nothing to do with your left_ and
right_delimiter-settings. the output of your included php-file (that
is the javascript-code etc.) is not parsed by smarty but passed
through to the browser.
greetings
messju
> Kai