[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.pdt] Re: Code Completion: <? rather than <?php

I'm grateful for both of your answers, thank you for your time and effort.

Ok, my complaint: <?= $something ?> against <?php echo $something; ?> makes it easier on the eyes for me, especially in tight html + javascript + url concatenating corners of my view code. That Eclipse doesn't wrap lines doesn't help either. It's nothing big, and I don't want to make a fuzz about it.

I try to keep my views pretty clean from logic, so I prefer to treat them like "HTML with some loops and variables" in contrast to "PHP with some string output". But when the future calls and tells me that I'm wrong, I'm probably on the wrong track.

I'm gonna use <?php echo 'stuff' ?> from now on. I'm still gonna miss my <?= ?>.

A toast to all those wonderful people who work on Eclipse and PDT, it's awesome and served me wonderfully in the last years and hopefully in years to come.

Best wishes:

   Daniel Dornhardt


Nick Boldt wrote:

One might argue that either:

a) it's the tool's responsibility to enforce Best Practices, by inserting <?php ?> instead of the lazier <? ?>; or

b) it's the tool's responsibility to provide enough rope to people so they can hang themselves, like when they have to move up to PHP6 and discover the lazy tags are no longer supported.

Me, I'd say +1 for making tools enforce good behaviour in support of language standards and requirements. After all, the tool's doing codegen for you so you don't have to type "php" after the "?". So, other than personal preference and the inclusion of a few extra characters, what's the complaint? Will three extra bytes per <?php ?> tag adversely affect your website / application's performance?

Nick

Roy Ganor wrote:
Hi,
in the Window -> Preferences -> PHP -> Editor -> Typing page you can set to NOT auto-complete the "php ?>".


I guess we should add the ability to configure the addition of the "php" as people tend (not recommended) to ignore them in some cases.

- Roy


Daniel Dornhardt wrote:

Hello,

Using "<? ?>" not recommended, in php6 short-tags are depreceated.
And default php.ini have short-tags disabled

Previously (Not sure when, some time before the 2.x Release) code assist allowed the use of short tags. I like them, especially for using php in view files and inserting things like <?= $username ?> and alternative syntax - style <? foreach($articles as $article): ?><? endforeach; ?> blocks. It seems really simpler and less threatening to non-programmers who aren't used to curly braces and everything, and it helps me keep my views nice and clean.

A matter of taste probably, but as I am as eccentric as every other human being, I'd like to have my good old way back. It doesn't have to be the default, I'm only interested on where to switch it on again.

If anybody has some advice on how to plug eclipse back to the old way, I'd be delighted.

Best wishes:

Daniel Dornhardt

On 25.12.2008 21:20, Igor wrote:
I like PDT. Thank you very much for a great work.

Question:
When I type "<?" the IDE immediately completes the "php ?>" for me.
Is there possibility to configure it, so that it appends just "?>"
without "php"? (so I get "<??>" instead "<?php ?>")

Looked around the Google for and couldn't find anything. Much thanks for
any insight.