Home » Language IDEs » PHP Development Tools (PDT) » Code Completion: <? rather than <?php
| |
Re: Code Completion: <? rather than <?php [message #88161 is a reply to message #87741] |
Sun, 04 January 2009 00:21 |
Daniel Dornhardt 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 |
Roy Ganor 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 |
Eclipse User |
|
|
|
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 |
Daniel Dornhardt 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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
>>>>>>>
>>>>>>>
>>>>
>>
>>
>>
>
|
|
| |
Goto Forum:
Current Time: Thu Dec 26 14:02:01 GMT 2024
Powered by FUDForum. Page generated in 0.03497 seconds
|