Commit 8229891d by Taylor Otwell

continued refactoring of view classes.

parent 15cde607
...@@ -37,9 +37,9 @@ return array( ...@@ -37,9 +37,9 @@ return array(
| |
*/ */
'GET /' => function($application) 'GET /' => function($laravel)
{ {
return $application->view->make('home.index'); return $laravel->view->make('home.index');
}, },
); );
\ No newline at end of file
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<h2><?php echo $apology; ?></h2> <h2><?php echo $apology; ?></h2>
<p>We couldn't find the resource you requested. Would you like go to our <a href="<?php echo Laravel\Config::get('application.url'); ?>">home page</a> instead?</p> <p>We couldn't find the resource you requested. Would you like go to our <a href="<?php echo $homepage; ?>">home page</a> instead?</p>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
class Download extends Response { class Download extends Response {
/** /**
* The file manager instance.
*
* @var File
*/
protected $file;
/**
* Create a new download generator instance. * Create a new download generator instance.
* *
* @param File $file * @param File $file
......
...@@ -57,6 +57,8 @@ class Response_Factory { ...@@ -57,6 +57,8 @@ class Response_Factory {
*/ */
public function error($code, $data = array()) public function error($code, $data = array())
{ {
$data['homepage'] = IoC::resolve('laravel.config')->get('application.url');
return new Response($this->view->make('error/'.$code, $data), $code); return new Response($this->view->make('error/'.$code, $data), $code);
} }
...@@ -221,4 +223,14 @@ class Response { ...@@ -221,4 +223,14 @@ class Response {
return $this; return $this;
} }
/**
* Magic Method for passing undefined static methods to the Response_Factory instance
* registered in the application IoC container. This provides easy access to the
* response functions while still maintaining testability within the classes.
*/
public static function __callStatic($method, $parameters)
{
return call_user_func_array(array(IoC::container()->resolve('laravel.response'), $method), $parameters);
}
} }
\ No newline at end of file
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
class View_Composer { class View_Composer {
/** /**
* The view composers.
*
* @var array
*/
protected $composers;
/**
* Create a new view composer instance. * Create a new view composer instance.
* *
* @param array $composers * @param array $composers
...@@ -60,6 +67,20 @@ class View_Composer { ...@@ -60,6 +67,20 @@ class View_Composer {
class View_Factory { class View_Factory {
/** /**
* The directory containing the views.
*
* @var string
*/
protected $path;
/**
* The view composer instance.
*
* @var View_Composer
*/
protected $composer;
/**
* Create a new view factory instance. * Create a new view factory instance.
* *
* @param array $composers * @param array $composers
...@@ -114,14 +135,6 @@ class View_Factory { ...@@ -114,14 +135,6 @@ class View_Factory {
/** /**
* Magic Method for handling the dynamic creation of named views. * Magic Method for handling the dynamic creation of named views.
*
* <code>
* // Create an instance of the "login" named view
* $view = View::of_login();
*
* // Create an instance of the "login" named view and bind data to the view
* $view = View::of_login(array('name' => 'Fred'));
* </code>
*/ */
public function __call($method, $parameters) public function __call($method, $parameters)
{ {
......
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