Per aspera ad astra
Home La SANDBOX
La SANDBOX Imprimer Envoyer
La sand box sert à stoker des variables et méthodes disponible partout dans votre xml. Très pratique...

<sandbox>
    <userobj>
        <php><![CDATA[
            // n'importe ou dans votre formulaire vous pourrez accéder à cette variable via un $this->oSandBox->message
            var $message = "";

            // cette fonction sera exécutée automatiquement à l'initialisation du formulaire
            function init() {
                $params = t3lib_div::_GET();
                $postId = $params['fiche'];

                // dans la sandbox on accéde au formulaire  avec $this->oForm
                $currentEntryId = $this->oForm->oDataHandler->currentEntryId();
                $fiche = ($currentEntryId) ? $currentEntryId : $postId;
                if (isset($fiche) && $fiche != "" && !$currentEntryId) {
                    // cette instruction permet de forcer l'édition d'un élément à l'initialisation
                    $this->oForm->forceEntryId($fiche);
                }
            }

        ]]></php>
    </userobj>
</sandbox>

Mise à jour le Lundi, 08 Mars 2010 03:51