[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/action/ -> sfActions.class.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the symfony package.
   5   * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
   6   * (c) 2004-2006 Sean Kerr.
   7   * 
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  /**
  13   * sfActions executes all the logic for the current request.
  14   *
  15   * @package    symfony
  16   * @subpackage action
  17   * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  18   * @author     Sean Kerr <skerr@mojavi.org>
  19   * @version    SVN: $Id: sfActions.class.php 3198 2007-01-08 20:36:20Z fabien $
  20   */
  21  abstract class sfActions extends sfAction
  22  {
  23    /**
  24     * Dispatches to the action defined by the 'action' parameter of the sfRequest object.
  25     *
  26     * This method try to execute the executeXXX() method of the current object where XXX is the
  27     * defined action name.
  28     *
  29     * @return string A string containing the view name associated with this action
  30     *
  31     * @throws sfInitializationException
  32     *
  33     * @see sfAction
  34     */
  35    public function execute()
  36    {
  37      // dispatch action
  38      $actionToRun = 'execute'.ucfirst($this->getActionName());
  39      if (!is_callable(array($this, $actionToRun)))
  40      {
  41        // action not found
  42        $error = 'sfAction initialization failed for module "%s", action "%s". You must create a "%s" method.';
  43        $error = sprintf($error, $this->getModuleName(), $this->getActionName(), $actionToRun);
  44        throw new sfInitializationException($error);
  45      }
  46  
  47      if (sfConfig::get('sf_logging_enabled'))
  48      {
  49        $this->getContext()->getLogger()->info('{sfAction} call "'.get_class($this).'->'.$actionToRun.'()'.'"');
  50      }
  51  
  52      // run action
  53      $ret = $this->$actionToRun();
  54  
  55      return $ret;
  56    }
  57  }


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7