Skip to content

Commit

Permalink
minor #5597 [CreateFramework] don't override existing variables (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

[CreateFramework] don't override existing variables

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | #5568

When extracting the request attributes, existing variables must not be
overridden so that the `$request` variable is passed to the template as
is.

Commits
-------

4b23fdc don't override existing variables
  • Loading branch information
wouterj committed Aug 20, 2015
2 parents f452b6e + 4b23fdc commit c0676f3
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 c0676f3

Please sign in to comment.