Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Code Completion: <? rather than <?php
Code Completion: <? rather than <?php [message #87725] Thu, 25 December 2008 19:20 Go to next message
Igor is currently offline IgorFriend
Messages: 1
Registered: July 2009
Junior Member
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.
Re: Code Completion: <? rather than <?php [message #87741 is a reply to message #87725] Fri, 26 December 2008 16:33 Go to previous messageGo to next message
Marko Karjalainen is currently offline Marko KarjalainenFriend
Messages: 30
Registered: July 2009
Member
Hey,

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

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.
>
>
Re: Code Completion: <? rather than <?php [message #88161 is a reply to message #87741] Sun, 04 January 2009 00:21 Go to previous messageGo to next message
Daniel Dornhardt is currently offline Daniel DornhardtFriend
Messages: 2
Registered: July 2009
Junior Member
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.
>>
>>
Re: Code Completion: <? rather than <?php [message #88174 is a reply to message #88161] Sun, 04 January 2009 06:46 Go to previous messageGo to next message
Roy Ganor is currently offline Roy GanorFriend
Messages: 149
Registered: July 2009
Senior Member
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.
>>>
>>>
Re: Code Completion: <? rather than <?php [message #88323 is a reply to message #88174] Mon, 05 January 2009 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickboldt+eclipse+newsgroup.gmail.com

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

--
Nick Boldt :: http://wiki.eclipse.org/User:Nickb
Re: Code Completion: <? rather than <?php [message #88353 is a reply to message #88323] Tue, 06 January 2009 00:53 Go to previous messageGo to next message
Daniel Dornhardt is currently offline Daniel DornhardtFriend
Messages: 2
Registered: July 2009
Junior Member
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.
>>>>>
>>>>>
>>
Re: Code Completion: <? rather than <?php [message #88368 is a reply to message #88353] Tue, 06 January 2009 03:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickboldt+eclipse+newsgroup.gmail.com

If it's any consolation, I had a co-op student last year who thought I
was a dinosaur / heathen for using echo instead of print in PHP scripts.
One coder's ambrosia will always be another's filth.

Seems we always have something to learn from others. :)

BTW, I haven't checked if PDT supports this in terms of proper
colouration, but I've been using this type of syntax for embedding large
chunks of HTML (optionally with embedded $variables) within PHP pages:

$branding = <<<EOHTML
<div id="branding">
<img src="images/projectdash.gif" alt="Dash"/>
</div>
EOHTML;

IIRC, it works with print and echo, too, whether assigned to a variable
first or not.

Doing tricks like this lets you easily have a single "<?php" on line one
and single "?>" on the last line without having to break in and out of
your <?php ?> tag to nest HTML blocks.

Cheers,

Nick

Daniel Dornhardt wrote:
> 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.
>>>>>>
>>>>>>
>>>
>
>
>

--
Nick Boldt :: http://wiki.eclipse.org/User:Nickb
Re: Code Completion: <? rather than <?php [message #88758 is a reply to message #88368] Wed, 07 January 2009 19:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

Blah...just switch the XHTML and XSLT.

Actually, my preference being

HTML with PHP embedded if it's an actual page, and separating the PHP
from the HTML when more business logic is needed. Less mixing of
presentation and business logic he better.

Dave

Nick Boldt wrote:
> If it's any consolation, I had a co-op student last year who thought I
> was a dinosaur / heathen for using echo instead of print in PHP scripts.
> One coder's ambrosia will always be another's filth.
>
> Seems we always have something to learn from others. :)
>
> BTW, I haven't checked if PDT supports this in terms of proper
> colouration, but I've been using this type of syntax for embedding large
> chunks of HTML (optionally with embedded $variables) within PHP pages:
>
> $branding = <<<EOHTML
> <div id="branding">
> <img src="images/projectdash.gif" alt="Dash"/>
> </div>
> EOHTML;
>
> IIRC, it works with print and echo, too, whether assigned to a variable
> first or not.
>
> Doing tricks like this lets you easily have a single "<?php" on line one
> and single "?>" on the last line without having to break in and out of
> your <?php ?> tag to nest HTML blocks.
>
> Cheers,
>
> Nick
>
> Daniel Dornhardt wrote:
>> 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.
>>>>>>>
>>>>>>>
>>>>
>>
>>
>>
>
Re: Code Completion: <? rather than <?php [message #90986 is a reply to message #87741] Mon, 19 January 2009 15:19 Go to previous message
Brent C is currently offline Brent CFriend
Messages: 1
Registered: July 2009
Junior Member
Actually, this is a common misconception of the changing coming in PHP 6.
Only ASP-style short tags (<% %>) will be deprecated and disabled by
default in PHP 6:

http://www.php.net/~derick/meeting-notes.html#remove-support -for-and-script-language-php-and-add-php-var

-Brent


Marko Karjalainen wrote:

> Hey,

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

> 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.
>>
>>
Previous Topic:Using Zend debugger across multiple PHP pages
Next Topic:PDT 2.0.1
Goto Forum:
  


Current Time: Thu Mar 28 08:38:46 GMT 2024

Powered by FUDForum. Page generated in 0.03630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top