Created
March 9, 2011 21:01
-
-
Save clayhinson/863000 to your computer and use it in GitHub Desktop.
Aliased Actions in Frapi, to provide multiple URL routes to the same code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'OtherAction.php' | |
class Action_AliasRouteForOtherAction extends Frapi_Action implements Frapi_Action_Interface | |
{ | |
protected $requiredParams = array(); | |
protected $data = array(); | |
public function toArray() {} | |
/** | |
* Alias all requests into other action | |
* | |
* @return array | |
*/ | |
public function executeAction() | |
{ | |
return $this->getInstance('OtherAction') | |
->setActionParams($this->getParams()) | |
->{$this->action}(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment