NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

New to Netbean & Joomla...Confuse about code template and code hinting

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
doxadigital



Joined: 17 Sep 2010
Posts: 5

PostPosted: Fri Sep 17, 2010 6:34 pm    Post subject: New to Netbean & Joomla...Confuse about code template and code hinting Reply with quote

Hello all,
i'm new to joomla development and have been using netbean for a week..
i got little confusion here:

1. Code Template
i already create Code Template with 'joomdef' as Abbreviation and "defined('_JEXEC') or die('Restricted access');" as expanded text. i set expand template on Tab.

however, i confuse how to trigger the code template because when there's nothing happen when i try to combine tab with 'joomdef'.

how to use code template properly ?

2. Code Hinting
In Joomla, there's plenty 'direct access' to a class. For example: JToolBarHelper::save();

i looking a way to have automatic code hinting to automatically display the public function for a class. i don't have problem when i use:
$test=new JToolBarHelper();

when i wrote '$test->' code hinting appeared.

Any idea how to activate it with '::' as trigger ?


i use: netbeans 6.9 on windows vista
Back to top
doxadigital



Joined: 17 Sep 2010
Posts: 5

PostPosted: Tue Sep 21, 2010 1:14 pm    Post subject: Reply with quote

hello,
i haven't find a clue to make code template works in netbeans ? any screencast or reference on how to do it ..

also same problem with '::' still appears...

appreciate any help
Back to top
doxadigital



Joined: 17 Sep 2010
Posts: 5

PostPosted: Thu Sep 23, 2010 4:33 pm    Post subject: It's getting weird Reply with quote

i try to code this simple .php

<?php

class testClass {
//put your code here
public function test(){
return "test class";
}
}

$temp=new testClass();
$temp->
?>

strangely the code hinting doesn't work... it gives me warning (red circle with !)..

Syntax error:
expected: identifier, variable,{,$

strange...

what might make code hinting feature fail to work ?
Back to top
Fran├žois Gannaz
Posted via mailing list.





PostPosted: Fri Sep 24, 2010 11:35 am    Post subject: New to Netbean & Joomla...Confuse about code template and code hinting Reply with quote

On 2010-09-17, "doxadigital" <address-removed> wrote:
Quote:
Hello all,
i'm new to joomla development and have been using netbean for a week..
i got little confusion here:

1. Code Template
i already create Code Template with 'joomdef' as Abbreviation and
"defined('_JEXEC') or die('Restricted access');" as expanded text. i set
expand template on Tab.

however, i confuse how to trigger the code template because when there's
nothing happen when i try to combine tab with 'joomdef'.

how to use code template properly ?

Did you set your code template for the right language, PHP?

Did you try to use the code templates that are shipped with Netbeans?

There's sometimes a conflict between the completion and the code templates. If
a completion tooltip appears, then "tab" won't work. So you have to type fast
enough. If some functions named "joomdef*" exist, they could be the culprits.

Quote:
2. Code Hinting
In Joomla, there's plenty 'direct access' to a class. For example:
JToolBarHelper::save();

i looking a way to have automatic code hinting to automatically display the
public function for a class. i don't have problem when i use: $test=new
JToolBarHelper();

when i wrote '$test->' code hinting appeared.

Any idea how to activate it with '::' as trigger ?

"MyClass::" should list the static functions in a tooltip. It works for me ;-)

I haven't looked at Joomla's code, but I know that it's compatible with PHP4.
If the function is well declared, Netbeans can know that it's static.
class JToolBarHelper {
public static function save() { ... }
}
Alas, the keyword "static" did not exist in PHP4, whose OO syntax was quite a
shame.

Netbeans can't guess the function attributes if the info is not in the code and
not in the PHPdoc bloc. In this case, it'll suppose it's not static:
class JToolBarHelper {
function save() { ... }
}
I guess Joomla didn't put "/** @static */" above this kind of declaration.

There's an ugly solution : Tools > Options > Editor > Code Completion. Set the
language to "PHP" and check "Also non-static methods after ::". This is a
global change, not per project.

Regards
--
Fran├žois
Back to top
Filip Zamboj
Posted via mailing list.





PostPosted: Fri Sep 24, 2010 11:50 am    Post subject: New to Netbean & Joomla...Confuse about code template and code hinting Reply with quote

On 09/17/2010 08:35 PM, doxadigital wrote:
Quote:
Hello all,
i'm new to joomla development and have been using netbean for a week..
i got little confusion here:

1. Code Template
i already create Code Template with 'joomdef' as Abbreviation and "defined('_JEXEC') or die('Restricted access');" as expanded text. i set expand template on Tab.

however, i confuse how to trigger the code template because when there's nothing happen when i try to combine tab with 'joomdef'.

how to use code template properly ?
the way you are describing is correct and it works for me. you have to
write between <??> tags, of course, and you cannot go there and back
within word. That means that if you make typo press delete and correct
yourself then code template won't be expanded.
Quote:
2. Code Hinting
In Joomla, there's plenty 'direct access' to a class. For example: JToolBarHelper::save();

i looking a way to have automatic code hinting to automatically display the public function for a class. i don't have problem when i use:
$test=new JToolBarHelper();

when i wrote '$test->' code hinting appeared.

Any idea how to activate it with '::' as trigger ?
Correct me if I am wrong but :: is for static methods, isn't it? It
should work automatically or use ctrl+space after :: .

class Test {
static function joomlaTest() {
return "I am static function";
}
}

class Test2 {
function joomlaTest2() {
return "I am not static function .. ";
}
}

$test = new Test();
$test->joomlaTest(); //is completed by Netbeans

Test::joomlaTest(); //is completed by Netbeans

$test = new Test2();
$test->joomlaTest2(); //is completed by Netbeans
Back to top
doxadigital



Joined: 17 Sep 2010
Posts: 5

PostPosted: Fri Sep 24, 2010 3:59 pm    Post subject: Reply with quote

Wierd... now eventhough i use $test-> no code hinting appears...

does my netbeans corrupt ? any idea to set to 'factory default' ... i miss the feature...
Back to top
doxadigital



Joined: 17 Sep 2010
Posts: 5

PostPosted: Fri Sep 24, 2010 5:26 pm    Post subject: Reply with quote

i realize i open several projects, could it be the cause that code hinting stop to work ?

i just uninstall and install new netbeans 6.9.1 , so far i only open a project and code hinting start to work again..
Back to top
zonadev



Joined: 24 Jul 2017
Posts: 2

PostPosted: Sat Aug 19, 2017 11:10 am    Post subject: Re: New to Netbean & Joomla...Confuse about code template and code hinting Reply with quote

doxadigital wrote:
Hello all,
i'm new to joomla development and have been using netbean for a week..
i got little confusion here:

1. Code Template
i already create Code Template with 'joomdef' as Abbreviation and "defined('_JEXEC') or die('Restricted access');" as expanded text. i set expand template on Tab.

however, i confuse how to trigger the code template because when there's nothing happen when i try to combine tab with 'joomdef'.

how to use code template properly ?

2. Code Hinting
In Joomla, there's plenty 'direct access' to a class. For example: JToolBarHelper::save();

i looking a way to have automatic code hinting to automatically display the public function for a class. i don't have problem when i use:
$test=new JToolBarHelper();

when i wrote '$test->' code hinting appeared.

Any idea how to activate it with '::' as trigger ?


i use: netbeans 6.9 on windows vista


It can help you to understand joomla development deeply.
https://magazine.joomla.org/issues/issue-jan-2012/item/655-Download-the-free-Joomla-Development-Guide
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo