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 ?
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 ?
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.