Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up use statements and fixed from comments

  • Loading branch information...
commit 7ade932d0a9ac9a147d7c27289e1310d8fdc36ac 1 parent b14b7d9
@rikh42 authored
Showing with 15 additions and 17 deletions.
  1. +15 −17 core/Controller.php
View
32 core/Controller.php
@@ -10,29 +10,26 @@
use snb\core\ContainerAware;
use snb\http\Response;
-
-use snb\core\DatabaseInterface;
use snb\http\Request;
-use snb\logger\LoggerInterface;
-use snb\form\FormBuilder;
-use snb\security\Auth;
-
-//==============================
-// Controller
-// Base class for controllers.
-//==============================
+
+/**
+ * A base class for Controllers that gives you a few handy helpers
+ */
class Controller extends ContainerAware
{
- //==============================
- // init
- // Called once the object has been created and features added.
- // Allows sub-classes to hook into this process and add in any features they need access to
- //==============================
+
+ /**
+ * Called once the object has been created and features added.
+ * Allows sub-classes to hook into this process and add in any features they need access to
+ * @return bool
+ */
public function init()
{
return true;
}
+
+
/**
* @param string $name
* @param array $data
@@ -40,7 +37,7 @@ public function init()
*/
public function render($name, array $data = array())
{
- return $this->container->get('view')->render($name, $data);
+ return $this->getView()->render($name, $data);
}
/**
@@ -133,6 +130,7 @@ public function redirectUrlResponse($url, Response $response = null)
if (preg_match("/^/[^/]/ui", $url) == 1)
{
// Add in the protocol and host
+ /* @var $request \snb\http\Request */
$request = $this->container->get('request');
if ($request) {
$url = $request->getHttpHost() . $url;
@@ -186,7 +184,7 @@ public function getRequest()
}
/**
- * @return LoggerInterface
+ * @return \snb\logger\LoggerInterface
*/
public function getLogger()
{
Please sign in to comment.
Something went wrong with that request. Please try again.