Created
April 22, 2016 23:42
-
-
Save daniellima/ad87ff60f5c5e51dbc7b336f910bd4b8 to your computer and use it in GitHub Desktop.
Vc pode usar então {{ ProcessoController::getAddURL(1,2) }}
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
| // Vc pode usar então {{ ProcessoController::getAddURL(1,2) }} | |
| // e será o equivalente à {{ action('ProcessoController@getAdd', array(1, 2)) }} | |
| // 15 caracteres a menos | |
| // Não é possivel errar o nome do controller, e ele pode ser autocompletado | |
| public static function __callStatic($name, $arguments) | |
| { | |
| if(substr($name, -3) == "URL"){ | |
| $actionName = substr($name, 0, -3); | |
| try { | |
| return action(get_called_class()."@".$actionName, $arguments); | |
| } catch(Exception $ex) { | |
| throw new BadMethodCallException(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment