Skip to content

Commit

Permalink
Work on section handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 6, 2012
1 parent 49b2d4a commit d2fefa6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion artisan
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.2.11
* @version 3.2.12
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
Expand Down
12 changes: 12 additions & 0 deletions laravel/documentation/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Contents

- [Laravel 3.2.12](#3.2.12)
- [Upgrading From 3.2.11](#upgrade-3.2.12)
- [Laravel 3.2.11](#3.2.11)
- [Upgrading From 3.2.10](#upgrade-3.2.11)
- [Laravel 3.2.10](#3.2.10)
Expand Down Expand Up @@ -47,6 +49,16 @@
- [Laravel 3.1](#3.1)
- [Upgrading From 3.0](#upgrade-3.1)

<a name="3.2.12"></a>
## Laravel 3.2.12

- Clear sections on a complete render operation.

<a name="upgrade-3.2.12"></a>
### Upgrading From 3.2.11

- Replace the **laravel** folder.

<a name="3.2.11"></a>
## Laravel 3.2.11

Expand Down
24 changes: 22 additions & 2 deletions laravel/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ class View implements ArrayAccess {
*/
public static $last;

/**
* The render operations taking place.
*
* @var int
*/
public static $render_count = 0;

/**
* The Laravel view loader event name.
*
Expand Down Expand Up @@ -327,19 +334,32 @@ public static function render_each($view, array $data, $iterator, $empty = 'raw|
*/
public function render()
{
static::$render_count++;

Event::fire("laravel.composing: {$this->view}", array($this));

$contents = null;

// If there are listeners to the view engine event, we'll pass them
// the view so they can render it according to their needs, which
// allows easy attachment of other view parsers.
if (Event::listeners(static::engine))
{
$result = Event::until(static::engine, array($this));

if ( ! is_null($result)) return $result;
if ( ! is_null($result)) $contents = $result;
}

if (is_null($contents)) $contents = $this->get();

static::$render_count--;

if (static::$render_count == 0)
{
Section::$sections = array();
}

return $this->get();
return $contents;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.2.11
* @version 3.2.12
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.2.11
* @version 3.2.12
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
Expand Down

0 comments on commit d2fefa6

Please sign in to comment.