|
Revision 23810, 1.9 kB
(checked in by Kris.Wallsmith, 4 years ago)
|
[1.3] set svn:eol-style property to native and svn:keywords property to Id on all .php files
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 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 |
* @param sfRequest $request The current sfRequest object |
|---|
| 30 |
* |
|---|
| 31 |
* @return string A string containing the view name associated with this action |
|---|
| 32 |
* |
|---|
| 33 |
* @throws sfInitializationException |
|---|
| 34 |
* |
|---|
| 35 |
* @see sfAction |
|---|
| 36 |
*/ |
|---|
| 37 |
public function execute($request) |
|---|
| 38 |
{ |
|---|
| 39 |
|
|---|
| 40 |
$actionToRun = 'execute'.ucfirst($this->getActionName()); |
|---|
| 41 |
|
|---|
| 42 |
if ($actionToRun === 'execute') |
|---|
| 43 |
{ |
|---|
| 44 |
|
|---|
| 45 |
throw new sfInitializationException(sprintf('sfAction initialization failed for module "%s". There was no action given.', $this->getModuleName())); |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
if (!is_callable(array($this, $actionToRun))) |
|---|
| 49 |
{ |
|---|
| 50 |
|
|---|
| 51 |
throw new sfInitializationException(sprintf('sfAction initialization failed for module "%s", action "%s". You must create a "%s" method.', $this->getModuleName(), $this->getActionName(), $actionToRun)); |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
if (sfConfig::get('sf_logging_enabled')) |
|---|
| 55 |
{ |
|---|
| 56 |
$this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Call "%s->%s()"', get_class($this), $actionToRun)))); |
|---|
| 57 |
} |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
return $this->$actionToRun($request); |
|---|
| 61 |
} |
|---|
| 62 |
} |
|---|
| 63 |
|
|---|