This has nothing to do with cake and everything to do with php for e.g. in any php file the following will work: <?php echo "wateva" ?> <?php echo "wateva else" ?> but this won't <?php echo "wateva" echo "wateva else" ?> The parser automatically assumes that if you close the <?php ... ?> tag you meant to put a semicolon there.
Dustin Weber wrote: > Tried searching for this, but it's a tough search to refine. > > Basically, I am simply trying to understand when/if we need semicolons > in a view when using a helper. In fact, I've noticed that I don't > even need the semicolon when just 'echoing' a var in a view, so it > isn't just related to helpers. > > It's something I had never much paid attention to (probably b/c it > didn't throw any errors, so simply didn't notice). > > So, in simple terms: > > <? php echo $widget['widgetModel']['widgetType']; ?> > ...seems to work the exact same as: > <? php echo $widget['widgetModel']['widgetType'] ?> > (notice the missing semicolon) > And: > <?php echo $html->input('Widget/searchBox', array('size' => '30')); ?> > ...seems to work the exact same as: > <?php echo $html->input('Widget/searchBox', array('size' => '30')) ?> > > So, I assume Cake is doing some error checking for us? However, is > this a feature (ie: should I assume I never have to type the > semicolons again in the views), or should I still add them so that I > am following the rules? > > The manual isn't clear on this in it's examples. For instance, I > pulled this code directly out of the helper section of the manual: > ----------------------------- > ... > <?php echo > $html->textarea('Note/body', array('cols'=>'60', 'rows'=>'10')); > ?> > <?php echo $html->tagErrorMsg('Note/body', > 'Please enter in a body for this note.') ?> > ... > ----------------------------- > (notice the semicolon inconsistency) > > > Thanks for any help in advance! > > Dustin Weber > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---