mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT: Provide a default Controller::Link() method, meaning that Controller objects can be constructed to help with testing forms.
This commit is contained in:
parent
9436ecb1ce
commit
06605ffadc
@ -84,6 +84,13 @@ class Controller extends RequestHandler {
|
|||||||
$this->baseInitCalled = true;
|
$this->baseInitCalled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a link to this controller. Overload with your own Link rules if they exist.
|
||||||
|
*/
|
||||||
|
function Link() {
|
||||||
|
return get_class($this) .'/';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes this controller, and return an {@link SS_HTTPResponse} object with the result.
|
* Executes this controller, and return an {@link SS_HTTPResponse} object with the result.
|
||||||
*
|
*
|
||||||
|
@ -297,7 +297,7 @@ class Security extends Controller {
|
|||||||
* @param string $action Name of the action
|
* @param string $action Name of the action
|
||||||
* @return string Returns the link to the given action
|
* @return string Returns the link to the given action
|
||||||
*/
|
*/
|
||||||
public static function Link($action = null) {
|
public function Link($action = null) {
|
||||||
return "Security/$action";
|
return "Security/$action";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user