Usual if syntax
if(){
}else{
}
Using colon
if:
else:
endif;
I am going through yii framework, and I see everywhere in the template the author has used the alternative colon syntax. I was wondering if there’s a significant advantage ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s just a matter of taste, really. If you come from a VB coding background, you may find it more familiar to use the colon syntax. Some people find that some code is easier to read when using Colon syntax. Use it if you find it appropriate.