functions:plugin_templatesetvars_foo

Cette fonction permet d'ajouter une variable à un template.

  • 'header' (site header)
  • 'footer' (site footer)
  • 'storytext', 'featuredstorytext', 'archivestorytext' (story templates)
  • 'story' (story submission)
  • 'comment' (comment submission form)
  • 'registration' (user registration form)
  • 'contact' (email user form)
  • 'emailstory' (email story to a friend)
function plugin_templatesetvars_foo($name, &$template)
{
    switch( $name ) {
        case 'story' :
            $template->set_var('hello', '<p>Hello world :)</p>');
            return;
        break;
        }
}

Il faut aussi ajouter au template en question, ici le submitstory.thtml, la variable {hello}.

Connecté en tant que : Guest (Guest)
dev/functions/plugin_templatesetvars_foo.txt · Dernière modification: 2010/02/24 15:34 par ::Ben
 

Download geeklog

Last version 1.8.1

Espace Membre





Devenir membre
Enregistrez-vous

Mot de passe oublié ?

Change language

Categories

  • Geeklog (38)
  • Plugins (53)
  • Thèmes (16)
  • My cart

    Votre panier (0 article)

    Votre panier est vide!

    0.00 EUR

    Visual Theme Switcher

    Test out available themes by selecting from one of the 6 available themes or give the Visual Switcher a try:

    Follow us on twitter

    En ligne

    Visiteurs: 7