Writing a PHP script

The simple approach would be to simply write the script in the global scope. Unfortunately this can bring to variable names clashing. If the same variable name is used by two slots in the same page, the second slot would see the variable of the first slot. This may cause misterious bugs and so this approach is not allowed by Obliquid security system.

    <?php
      ...
      $_obweb->smslot->assign("templatevar", $templatevar);
    ?>

Generally slot script are short: this is an advantage of this architecture that divides the page in its elements. Even if a slot has to deliver complicated functionality it is better to put this in a separate class and keep the script short.

    <?php
    function core_nav_() {
        global $_obweb;
        ...
        $_obweb->smslot->assign("templatevar", $templatevar);
    }

The function name must be modulename_slotname_() for Obliquid to be able to call it. Also notice that there is no PHP end tag, to avoid any headers already sent problem, caused by extra blank lines added by mistake after the closing tag.