Skip to content

Instantly share code, notes, and snippets.

@clayhinson
Created March 9, 2011 21:01
Show Gist options
  • Save clayhinson/863000 to your computer and use it in GitHub Desktop.
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.
<?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