✏️ 编辑:sfActions.class.php
路径:
/virtual/bigbrother/sns/lib/symfony/action/sfActions.class.php
大小:1.99 KB · 修改:2010-08-11 06:11:37 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> * (c) 2004-2006 Sean Kerr <sean@code-box.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfActions executes all the logic for the current request. * * @package symfony * @subpackage action * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @author Sean Kerr <sean@code-box.org> * @version SVN: $Id: sfActions.class.php 19911 2009-07-06 07:52:48Z FabianLange $ */ abstract class sfActions extends sfAction { /** * Dispatches to the action defined by the 'action' parameter of the sfRequest object. * * This method try to execute the executeXXX() method of the current object where XXX is the * defined action name. * * @param sfRequest $request The current sfRequest object * * @return string A string containing the view name associated with this action * * @throws sfInitializationException * * @see sfAction */ public function execute($request) { // dispatch action $actionToRun = 'execute'.ucfirst($this->getActionName()); if ($actionToRun === 'execute') { // no action given throw new sfInitializationException(sprintf('sfAction initialization failed for module "%s". There was no action given.', $this->getModuleName())); } if (!is_callable(array($this, $actionToRun))) { // action not found throw new sfInitializationException(sprintf('sfAction initialization failed for module "%s", action "%s". You must create a "%s" method.', $this->getModuleName(), $this->getActionName(), $actionToRun)); } if (sfConfig::get('sf_logging_enabled')) { $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Call "%s->%s()"', get_class($this), $actionToRun)))); } // run action return $this->$actionToRun($request); } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF