How to Include File

How to include file in PHP NB IDE? Two ways:

  1. file system code completion for include/require
  2. Fast Import Alt+Shift-I

The first one is probably no surprise because is included in NB since 6.5

Include, Require CC

The second one was added into 6.7

Fast Import

Fast Import, looks at the identifier under the editor caret, then tries to locate the file and if successful we get the dialog like in the screenshot above. The choice is obvious and after pressing "Enter" we are done and include or require statement is generated.  By pressing "ALt+Enter" the statement will be generated just before the current line.


Comments:

Good work.
The "Fast Import" may be a common requirement for dynamic language.

I hope it works in HTML/JSP/PHP file for importing javascript file and css file. I found there are no definition detect for js object and css class in HTML/JSP/PHP file now.

Posted by hantsy on May 07, 2009 at 05:21 AM CEST #

Is there a way to change or extend NetBeans' syntax highlighting? I'm currently using JEdit and it has a lot more token types defined.

Sorry for the off-topic comment.

Posted by Dave on May 07, 2009 at 11:34 AM CEST #

Great would be possibility to configure way how auto impor work, because many programators use relative include to actual script, like this:

require_once realpath(dirname(__FILE__).'/dibi.compact.php');

This way doesn't require any special setting of include path.

Posted by Tomas on May 07, 2009 at 01:18 PM CEST #

Thanks for feedback

To hantsy:
if you would like to see this feature implemented also for js objects, css class,id then please report it: http://www.netbeans.org/community/issues.html

To Dave:
you can't change tokens, but you can change colors in Tools|Options|Fonts&Colors

To Tomas:
yes, you are right that the approach how to include file is various and we could take it into account. You can report it: http://www.netbeans.org/community/issues.html

Posted by radek on May 10, 2009 at 03:58 AM CEST #

What happened with blog? 20 days w/o articles

Posted by heaver on May 29, 2009 at 08:26 AM CEST #

Just an offtopic, which I apologize for ;)
Is there a plan to add automatic model generation to Netbeans PHP? I've noticed the SQL autocomplete inside PHP code, which is really cool.
But why not take it a step forward and add a refactoring method that takes a DB table and extracts the fields as class members?
Keep up the good work

Posted by Costin on June 03, 2009 at 01:48 AM CEST #

@heaver:
we were very busy: 6.7 is finishing, planning/prototyping for 6.8 and so on but stay tuned

@Costin
would be nice but to be honest for 6.8 not sure but definitely report it and describe how you would like it to be implemented

Posted by radek on June 04, 2009 at 03:06 AM CEST #

thanks

Posted by Film İzle on June 19, 2009 at 01:05 PM CEST #

it is good that you are helping

Posted by bala on July 17, 2009 at 01:48 AM CEST #

Thanks..

Posted by aşk şiirleri on July 28, 2009 at 10:43 PM CEST #

« Introduce Variable... | Main | PHP Application from... »
How to Include File
Posted by Radek Matous on May 07 2009, 09:05:17 AM CEST

How to include file in PHP NB IDE? Two ways:

1. file system code completion for include/require
2. Fast Import Alt+Shift-I

The first one is probably no surprise because is included in NB since 6.5

Include, Require CC

The second one was added into 6.7

Fast Import

Fast Import, looks at the identifier under the editor caret, then tries to locate the file and if successful we get the dialog like in the screenshot above. The choice is obvious and after pressing "Enter" we are done and include or require statement is generated. By pressing "ALt+Enter" the statement will be generated just before the current line.

Category: Tips & Tricks | Permalink | Comments [10]

Trackback URL: http://blogs.sun.com/netbeansphp/entry/include_require
Comments:

Good work.
The "Fast Import" may be a common requirement for dynamic language.

I hope it works in HTML/JSP/PHP file for importing javascript file and css file. I found there are no definition detect for js object and css class in HTML/JSP/PHP file now.

Posted by hantsy on May 07, 2009 at 12:21 PM CEST #

Is there a way to change or extend NetBeans' syntax highlighting? I'm currently using JEdit and it has a lot more token types defined.

Sorry for the off-topic comment.

Posted by Dave on May 07, 2009 at 06:34 PM CEST #

Great would be possibility to configure way how auto impor work, because many programators use relative include to actual script, like this:

require_once realpath(dirname(__FILE__).'/dibi.compact.php');

This way doesn't require any special setting of include path.

Posted by Tomas on May 07, 2009 at 08:18 PM CEST #

Thanks for feedback

To hantsy:
if you would like to see this feature implemented also for js objects, css class,id then please report it: http://www.netbeans.org/community/issues.html

To Dave:
you can't change tokens, but you can change colors in Tools|Options|Fonts&Colors

To Tomas:
yes, you are right that the approach how to include file is various and we could take it into account. You can report it: http://www.netbeans.org/community/issues.html

Posted by radek on May 10, 2009 at 10:58 AM CEST #

What happened with blog? 20 days w/o articles

Posted by heaver on May 29, 2009 at 03:26 PM CEST #

Just an offtopic, which I apologize for ;)
Is there a plan to add automatic model generation to Netbeans PHP? I've noticed the SQL autocomplete inside PHP code, which is really cool.
But why not take it a step forward and add a refactoring method that takes a DB table and extracts the fields as class members?
Keep up the good work

Posted by Costin on June 03, 2009 at 08:48 AM CEST #

@heaver:
we were very busy: 6.7 is finishing, planning/prototyping for 6.8 and so on but stay tuned

@Costin
would be nice but to be honest for 6.8 not sure but definitely report it and describe how you would like it to be implemented

Posted by radek on June 04, 2009 at 10:06 AM CEST #

thanks

Posted by Film İzle on June 19, 2009 at 08:05 PM CEST #

it is good that you are helping

Posted by bala on July 17, 2009 at 08:48 AM CEST #

Thanks..

Posted by aşk şiirleri on July 29, 2009 at 05:43 AM CEST #
Post a Comment:

Name:
E-Mail:
URL:
Notify me by email of new comments
Remember Information?

Your Comment:

HTML Syntax: NOT allowed

Please answer this simple math question

7 + 9 =

Posted by deeper voice on August 29, 2009 at 05:07 AM CEST #

Are are done and include or require statement is generated. By pressing "ALt+Enter" the statement will be generated just before the current line.

Posted by Malware Removal Bot on September 02, 2009 at 04:08 AM CEST #

As noted, problems suach as INCORRECT information are of the CRA’s making, not the individual’s. If the information is correct, then the service can’t help.

Posted by RegCure Review on October 29, 2009 at 03:50 AM CET #

Is there a plan to add automatic model generation to Netbeans PHP? I've noticed the SQL autocomplete inside PHP code, which is really cool.http://www.watchesshow.com/

Posted by wathces on December 16, 2009 at 09:41 PM CET #

I hope it works in HTML/JSP/PHP file for importing javascript file and css file. I found there are no definition detect for http://www.ebagsell.com/ js object and css class in HTML/JSP/PHP file now.

Posted by louis vuitton on December 16, 2009 at 09:44 PM CET #

yes, you are right that the approach how to include file is various and we could take it into account.

Posted by Louis Vuitton on February 02, 2010 at 09:28 AM CET #

Include, Require CC

The second one was added into 6.7

Posted by louis vuitton handbags on February 02, 2010 at 09:29 AM CET #

Code completion doesn't seem to work if the include path begins with '../'

Posted by David on February 03, 2010 at 07:28 AM CET #

why include for 2 times ???

Posted by 640-802 on February 05, 2010 at 07:28 PM CET #

The second one was added into 6.7
yes, you are right that the approach how to include file is various and we could take it into account.

Posted by louis vuitton on August 04, 2010 at 08:44 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today