Re: Re: PHP in HTML code
| From: | Adam Richardson | Date: | Thu, 18 Mar 2010 17:06:53 +0000 |
| Subject: | Re: Re: PHP in HTML code | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302978@lists.php.net to get a copy of this message | ||
On Thu, Mar 18, 2010 at 11:28 AM, tedd <tedd.sperling@gmail.com> wrote:
> At 9:34 AM +0000 3/18/10, Pete Ford wrote:
>
>>
>> I do tend to use <?php for blocks of code - so I guess I'm in the middle
>> camp here.
>>
>
>
> Whoa, that's even worse -- make a choice and stick with it -- IMO.
>
> I'm all for consistency and have often found myself redoing dozens of
> scripts because I changed something -- not because the change worked and the
> other didn't, but rather to maintain consistency throughout the project.
>
> Granted, different reasons promote different programming styles. While what
> I do is to solve the problem at hand for the client, it also has to pass
> through my vision of code elegance. I program for myself first and solve the
> client's problems second. I also realize that I have the privilege of doing
> so because my needs are few. I probably wouldn't do well in a production
> oriented environment.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com
> http://ancientstones.com =[jLrÖ9¥JHßò
> Bhttp://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
What Pete described is consistent.
For blocks that merely echo out a variable in templates or views, he uses a
<?=, and in code that's actually doing some manipulation, he uses <?php.
This consistency does make it very easy to discern the difference, saves on
typing, and similar approaches are used in other frameworks (e.g., ASP.Net),
too.
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com