Commit 8229891d authored by Taylor Otwell's avatar Taylor Otwell

continued refactoring of view classes.

parent 15cde607
......@@ -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 @@
<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>
</body>
</html>
\ No newline at end of file
......@@ -2,6 +2,13 @@
class Download extends Response {
/**
* The file manager instance.
*
* @var File
*/
protected $file;
/**
* Create a new download generator instance.
*
......
......@@ -57,6 +57,8 @@ class Response_Factory {
*/
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);
}
......@@ -221,4 +223,14 @@ class Response {
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
......@@ -8,6 +8,13 @@
*/
class View_Composer {
/**
* The view composers.
*
* @var array
*/
protected $composers;
/**
* Create a new view composer instance.
*
......@@ -59,6 +66,20 @@ class View_Composer {
*/
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.
*
......@@ -114,14 +135,6 @@ class View_Factory {
/**
* 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)
{
......
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