2008年8月22日星期五

Re: [fw-mvc] controller syntax

The end closing is more geared towards not having EOF Issues within PHP
Files. It is not specific for controllers. For instance, a model as well
should just "not end". Take this, for example:

<?php

class Orange
{

protected $_var;

}

?>
LINE BREAK
EOF

As you can see, the line break itself causes parsing issues. Example B:


<?php

class Orange
{

protected $_var;

}

LINE BREAK
EOF

Here, the EOF does not send output because the php script is still
processing.

Hope this helps.

spaceage wrote:
>
> As a noob, I just learned the hard way about the problem with having a
> closing "?>" in a controller file. This seems highly unorthodox, plus I
> don't recall reading anything about this in the docs here...I found an
> obscure reference in the "Practical Web 2.0" book.
>
> My questions are:
>
> 1) Is it always the case that controller files DO NOT have a closing "?>"?
>
> 2) Are there other areas of the framework where you must omit the closing
> "?>"?
>
>
>

--
View this message in context: http://www.nabble.com/controller-syntax-tp19114427p19118402.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: