Fork me on GitHub

Change Smarty Delimiters  Bottom

  • Hi there,

    I have tried, but there seemes to be no way to change the pnrender delimters from to {$example} - I want to do this because it is "bad form' (IMHO) to put HTML comments in urls.

    TIA

    -Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • If it's for yourself (not distributed) and you're OK with hacking the core, it's in /includes/pnRender.class.php

    Code

    // first, get a native Smarty object
            $this->Smarty();

            // begin holder tag (be nice to others)
            $this->left_delimiter = '<!--[';
            // end holder tag
            $this->right_delimiter = ']-->';

    Of course, if you mess with those, you'll break all the other module templates :) Or better yet, issue the above commands for your module only.
    I don't know what you mean about putting them in URLs, how they appear in the template is quite irrelevant. I suppose you mean editing in something like Dreamweaver, you don't like how they appear as comments.
    Safest bet, leave 'em alone, but that's your biz.
  • Just to clarify Martin's post a bit you can set your own delimiters for your own modules using pnRender. Like Martin has said the template code is never exposed to the browser so it's not really an issue aside from within an editor. Anyway the code to do this in your module would be

    Code

    $pnRender =& new pnRender('mymod');

        // begin holder tag (be nice to others)
        $pnRender->left_delimiter = '{';
        // end holder tag
        $pnRender->right_delimiter = '}';


    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.