Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblizzz <blizzz@owncloud.com>2014-04-07 12:19:18 +0400
committerblizzz <blizzz@owncloud.com>2014-04-07 12:19:18 +0400
commit0c444fb2fbf84f76eab03b1a17f4609cd89dede7 (patch)
tree5c3792e8dfb01abe5af53892fa8e624a44dd61b7 /lib/public
parente295d48fd43e0aab8fe4120d1b4a302edab343b2 (diff)
parent5f3b8c45d73451d511242a3aabc768520273c40c (diff)
Merge pull request #8017 from Raydiation/master
Remove dependency on container, removing service locator antipattern
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/appframework/controller.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php
index 7c2219bd046..758f0a80083 100644
--- a/lib/public/appframework/controller.php
+++ b/lib/public/appframework/controller.php
@@ -38,10 +38,10 @@ use OCP\IRequest;
abstract class Controller {
/**
- * app container for dependency injection
- * @var \OCP\AppFramework\IAppContainer
+ * app name
+ * @var string
*/
- protected $app;
+ protected $appName;
/**
* current request
@@ -51,11 +51,11 @@ abstract class Controller {
/**
* constructor of the controller
- * @param IAppContainer $app interface to the app
+ * @param string $appName the name of the app
* @param IRequest $request an instance of the request
*/
- public function __construct(IAppContainer $app, IRequest $request){
- $this->app = $app;
+ public function __construct($appName, IRequest $request){
+ $this->appName = $appName;
$this->request = $request;
}
@@ -136,7 +136,7 @@ abstract class Controller {
*/
public function render($templateName, array $params=array(),
$renderAs='user', array $headers=array()){
- $response = new TemplateResponse($this->app->getAppName(), $templateName);
+ $response = new TemplateResponse($this->appName, $templateName);
$response->setParams($params);
$response->renderAs($renderAs);