CodeIgniter Forums
User Guide Examples and Closing PHP tag - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: User Guide Examples and Closing PHP tag (/showthread.php?tid=31663)



User Guide Examples and Closing PHP tag - El Forum - 06-27-2010

[eluser]ray023[/eluser]
The Style Guide mentions that the closing php tag should not be used.

However, I've noticed the controller examples for things like the File Uploading Class and the Form Validation Class have the closing PHP tag.

I'm still learning CodeIgniter so I just want to verify that we should indeed use the closing comment version of the file rather than a closing PHP tag.


User Guide Examples and Closing PHP tag - El Forum - 06-28-2010

[eluser]WanWizard[/eluser]
Use the closing comment, not the closing PHP tag.

The Form Validation and Upload class don't have a PHP closing tag in CI 1.7.2, which version are you using?


User Guide Examples and Closing PHP tag - El Forum - 06-28-2010

[eluser]ray023[/eluser]
1.7.2.

Will close my controllers with the comment.

Thanks for the reply Smile


User Guide Examples and Closing PHP tag - El Forum - 06-28-2010

[eluser]InsiteFX[/eluser]
A lot of people get this wrong!

As stated above use the colosing comments,
the reason you see some the old way is because
its old code that has not been updated etc.

InsiteFX