Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

Home > en > Functionalities > Actions and processes > The contents of an action file

The contents of an action file

An action file provides at least one function matching its own filename. A file called action/laugh.php should therefore declare a function called action_laugh_dist().

  1. <?php
  2. if (!defined("_ECRIRE_INC_VERSION")) return;
  3.  
  4. function action_laugh_dist(){
  5.  
  6. }
  7. ?>

Download

Operation of the function

In general, the main function is divided into 2 sections: verification of authorisations, then execution of the requested process.

  • Published : 07/12/09
  • Translations : English, français