Skip to content

Switches all appropriate echos to the short echo#1137

Closed
alecho wants to merge 3 commits intocakephp:3.0from
alecho:feature-convert-to-short-echo
Closed

Switches all appropriate echos to the short echo#1137
alecho wants to merge 3 commits intocakephp:3.0from
alecho:feature-convert-to-short-echo

Conversation

@alecho
Copy link
Contributor

@alecho alecho commented Mar 8, 2014

I will comment on some lines. Looking for feedback on this.

@bcrowe
Copy link
Contributor

bcrowe commented Mar 8, 2014

By the way, there's a current PR pending for the blog tutorial: #1133

@alecho
Copy link
Contributor Author

alecho commented Mar 8, 2014

@bcrowe Good to know. I can rebase after that is in 3.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While semicolons are not needed at end of statement when using short echo tags, personally I would prefer cake recommending using them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bcrowe Let's see if others have an opinion on this. Else we keep it without semicolons. While i would prefer having them wouldn't really mind if we chose to skip them either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ADmad I'm on the same ⛵

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the lack of a semicolon on the single lines, like this one, above look cleaner and feels more like a templating language syntax like handlebars. Besides that I don't really have a preference either way.

Just as a reminder there was some discussion on this about 2 months back: cakephp/cakephp#2596

@bcrowe We can always change the CS to match 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with not having the semicolon. There is a technical reason for keeping them though, at it is that php will trim new lines (or was it preserve?) after the closing ?> if a semicolon is used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lorenzo Must be UNIX thing then, as I made a quick test for Windows8 (PHP5.4) and it did not change behavior at all. One newline is always swallowed (after the closing tag).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember the details of how it used to work :S

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with no semicolon either. We should however, be showing h() being used on any values coming from user input. That can be a separate pull request though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markstory Or more appropriately: All user input and all stringish non-HTML (db) values outputted (to avoid some characters breaking the HTML).

@markstory
Copy link
Member

I think this looks fine to merge as it stands.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tmp" is now moved out of "App", so this should be just tmp.

markstory added a commit that referenced this pull request Mar 10, 2014
@markstory
Copy link
Member

Rebased and merged in 2f1e247

@markstory markstory closed this Mar 10, 2014
@ravage84 ravage84 modified the milestone: 3.x Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants