Skip to content

Commit

Permalink
don't override existing variables
Browse files Browse the repository at this point in the history
When extracting the request attributes, existing variables must not be
overridden so that the `$request` variable is passed to the template as
is.
  • Loading branch information
xabbuh committed Aug 4, 2015
1 parent bde40f9 commit 4b23fdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions create_framework/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rendered::

function render_template($request)
{
extract($request->attributes->all());
extract($request->attributes->all(), EXTR_SKIP);
ob_start();
include sprintf(__DIR__.'/../src/pages/%s.php', $_route);

Expand Down Expand Up @@ -110,7 +110,7 @@ Here is the updated and improved version of our framework::

function render_template($request)
{
extract($request->attributes->all());
extract($request->attributes->all(), EXTR_SKIP);
ob_start();
include sprintf(__DIR__.'/../src/pages/%s.php', $_route);

Expand Down

0 comments on commit 4b23fdc

Please sign in to comment.