Commit 01894ae4 authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #651 from dlpetrie/patch-4

Controller property Bundle ( and some additions )
parents d0edf92e 8a8d3319
...@@ -25,6 +25,20 @@ abstract class Controller { ...@@ -25,6 +25,20 @@ abstract class Controller {
* @var string * @var string
*/ */
public $bundle; public $bundle;
/**
* The controllers name
*
* @var string
*/
public $name;
/**
* The controllers action
*
* @var string
*/
public $action;
/** /**
* Indicates if the controller uses RESTful routing. * Indicates if the controller uses RESTful routing.
...@@ -140,9 +154,13 @@ abstract class Controller { ...@@ -140,9 +154,13 @@ abstract class Controller {
// improve speed since the bundle is not loaded on every request. // improve speed since the bundle is not loaded on every request.
Bundle::start($bundle); Bundle::start($bundle);
list($controller, $method) = explode('@', $destination); list($controller_name, $method) = explode('@', $destination);
$controller = static::resolve($bundle, $controller); $controller = static::resolve($bundle, $controller_name);
$controller->bundle = $bundle;
$controller->name = $controller_name;
$controller->action = $method;
// If the controller could not be resolved, we're out of options and // If the controller could not be resolved, we're out of options and
// will return the 404 error response. If we found the controller, // will return the 404 error response. If we found the controller,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment