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

Use long tags instead of short tags in templates. #954

Closed
wants to merge 1 commit into from

Conversation

demiankatz
Copy link
Member

@demiankatz demiankatz commented Apr 7, 2017

Discussion of #913 brought up this idea -- short tags are not really recommended PHP practice at this point. Can we live with using regular <?php tags in our templates? This PR shows what it would look like. Please discuss below.

TODO

@bemosior bemosior mentioned this pull request Apr 7, 2017
1 task
@crhallberg
Copy link
Contributor

crhallberg commented Apr 7, 2017

Would it be a good idea or a good time to use a light templating engine? That way we can follow best practices and keep the readability? I take this back, every template engine I looked at would not solve this problem easily.

@demiankatz
Copy link
Member Author

The experience of using (and eventually abandoning) Smarty has left me fairly skeptical about template engines in general. There are certainly some pain points to pure PHP templates that an engine might alleviate, but to my mind, they're not currently severe enough to outweigh the benefit of avoiding a new dependency and introducing extra overhead into view rendering. (Not to mention the huge effort likely needed to rewrite all of our view helpers for some other platform).

@crhallberg
Copy link
Contributor

I agree. And since that's the case, I could live with long tags in templates.

I may scan through this PR and see what this does to some of the more complex inline statements. Maybe this can make a different approach better.

@crhallberg
Copy link
Contributor

What's the take on short echo statements like <?=?

@demiankatz
Copy link
Member Author

Short echo is okay -- nobody seems to object to it, and PHP has support for it turned on by default. It's just plain short tags that are a problem because they're off by default and more potentially ambiguous when mixing tools.

@demiankatz
Copy link
Member Author

This is rendered obsolete by #1063.

@demiankatz demiankatz closed this Oct 24, 2017
@demiankatz demiankatz deleted the long_opening_tags branch October 22, 2019 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants