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

Add more helpers #1

Closed
siiptuo opened this issue Mar 20, 2015 · 3 comments
Closed

Add more helpers #1

siiptuo opened this issue Mar 20, 2015 · 3 comments

Comments

@siiptuo
Copy link

siiptuo commented Mar 20, 2015

Currently this has only url_for function. The old Slim-Views has 4 different helpers. A simple solution would be to add Slim\App as a global. It would look like this:

{% if slim.request.isGet %}
    <a href="{{ slim.request.uri.basepath ~ slim.router.urlFor('home') }}">link</a>
{% endif %}

It's not as pretty as few selected helpers but the API is would same as in PHP code. Unfortunately it would also make it possible to include application logic into templates which may have unwanted side effects.

@akrabat
Copy link
Member

akrabat commented May 12, 2015

I'd rather see a PR for specific additional helpers.

@silentworks
Copy link
Member

These should probably be split back out as the original was, so we have a separate class for the helpers in the repo.

@akrabat
Copy link
Member

akrabat commented Jul 5, 2015

See #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants