-
Notifications
You must be signed in to change notification settings - Fork 5
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
PHP template style guide? #453
Comments
I completely agree. I think your proposition (1) is the best in templates. I discovered it later, so this is why almost all of these blocks use the style (3), which we kept using for consistency. IMO the style (2) should be completely avoided, and it should be very rare in the current templates. I think that:
|
Oh yeah, this one is not cool ! I agree that it should not be used. Between your two proposals, I would say that the second one, with bracket, is the style already used every where. So maybe not mixing way to write this is a good idea. But I feel you when you say that it's not very visual. So, I don't know. Maybe there could be a standard for views different from the rest. I'm curious about @n-peugnet 's opinion on this |
Interesting but this seems not an easy refactor to me. |
Among the app/view/templates, I think that I’ll go through every file, where HTML homogeneity will be the key. |
I'm totally ok theoretically, but as I said, the refacture looks a bit rude in the non-templates parts. But maybe some magical regex could help 😋 I give it a try quickly to see how I feel about it. |
If done in a single commit as a standalone change, and it you do not change any indentation, it would be very easy to review, so I am in favour of it.
It should not be changed in non-template files. |
aaahha okk, my bad, I misread what you wrote. Ok so it's chill for me ! And yess, one transition commit with this on templates would be lovely ❤️ |
Hmf. What a journey (there is quite a bunch of templates…). PS: I did two commits: one with simple switch and no re-indent, the other more complex, with re-indent. |
closed by #454 |
More a question than an issue…
Could we, especially within the admin / view / templates use this syntax:
instead of this one:
or even this one (that I find hard to catch with its closing brackets):
Apart of if/else/endif, I’ve got the same question with foreach / endforeach loops.
Within the templates, where a lot of HTML is echoed, I tend to find the first one cleaner, even slightly more verbose at some points. But I will stick to what you prefer.
The text was updated successfully, but these errors were encountered: