Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make template keyword global (GH #1159): #1163

Closed
wants to merge 3 commits into from

Conversation

xsawyerx
Copy link
Member

This makes sure the template keyword is available outside the request process. The request object (including the parameters and variables) will not be available during that template call.

This makes sure the `template` keyword is available outside the
request process. The request object (including the parameters and
variables) will not be available during that `template` call.
Sessions are lazy, however we instantiate them before rendering a
template within a request.

When using `template` as a global keyword, we need to check that a
request exists *AND* a sesison exists (for the request).
@veryrusty veryrusty force-pushed the feature/global-template-keyword branch from f24c486 to 3ad59bb Compare April 29, 2016 15:39
@veryrusty
Copy link
Member

Added test case and predicate checks for a request before calling has_session which looks for a cookie in the request.

( Session objects are lazy; when a request exists we inflate the session object before rendering a template if the route code didn't require the session be instantiated. )

@xsawyerx
Copy link
Member Author

@girlwithglasses what do you think?

@ialarmedalien
Copy link

Looks great to me -- thank you!

@xsawyerx
Copy link
Member Author

xsawyerx commented May 5, 2016

Should we merge this too?

@veryrusty
Copy link
Member

Would be nice to get one more thumbup. Pinging @racke, @SysPete or @cromedome for review

@SysPete
Copy link
Member

SysPete commented May 5, 2016

👍 looks good to me. Change is small and there are people out there who want this.

@veryrusty
Copy link
Member

Thanks everyone. Merged as 5d3cdca. 👯

@veryrusty veryrusty closed this May 5, 2016
@veryrusty veryrusty deleted the feature/global-template-keyword branch May 5, 2016 12:18
xsawyerx added a commit that referenced this pull request May 27, 2016
    [ BUG FIXES ]
    * GH #1165, #1167: Copy is_behind_proxy attribute into new request
      on forward. (Russell Jenkins)

    [ ENHANCEMENTS ]
    * GH #1120: Move from MooX::Types::MooseLike to Type::Tiny for
      performance. (Peter Mottram)
    * GH #1145, #1164: Replace Class::Load with Module::Runtime
      (Sawyer X)
    * GH #1159, #1163: Make template keyword global.
      (Sawyer X, Russell Jenkins)

    [ DOCUMENTATION ]
    * GH #1158: List both static and shared modules in Apache's deploy
      instructions. (Varadinsky)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants