fortruth
Joined: 26 Aug 2008 Posts: 26
|
Posted: Thu Aug 20, 2009 12:03 pm Post subject: autocomplete for class members |
|
|
but I am using nb7.1 two sites all don't work.!!
2009/8/20 Pet <address-removed ([email]address-removed[/email])>
| Quote: | class AdminController{
|
|
| Back to top |
|
 |
radek matous Posted via mailing list.
|
Posted: Thu Aug 20, 2009 3:02 pm Post subject: autocomplete for class members |
|
|
管俊明 wrote:
| Quote: | but I am using nb7.1 two sites all don't work.!!
| Use @property for fields, @var just for variables
Radek
| Quote: |
2009/8/20 Pet <address-removed <mailto:address-removed>>
class AdminController{
/* @var $admin Admin */
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin-> //here it will work
$this->admin-> //here it will not work
}
}
Hi,
I'm pretty sure it wasn't a problem with earlier versions of NB but in
6.8m1 auto complete for $this->admin-> doesn't work. It should suggest
methods of class Admin
Am I missing something?
Pet
<mailto:address-removed>
<mailto:address-removed>
|
|
|
| Back to top |
|
 |
Pet Posted via mailing list.
|
Posted: Thu Aug 20, 2009 4:46 pm Post subject: autocomplete for class members |
|
|
On Thu, Aug 20, 2009 at 5:01 PM, radek matous<address-removed> wrote:
| Quote: | 管俊明 wrote:
| Quote: |
but I am using nb7.1 two sites all don't work.!!
|
Use @property for fields, @var just for variables
|
still don't work, could you provide full example?
| Quote: |
Radek
| Quote: |
2009/8/20 Pet <address-removed <mailto:address-removed>>
class AdminController{
/* @var $admin Admin */
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin-> //here it will work
$this->admin-> //here it will not work
}
}
Hi,
I'm pretty sure it wasn't a problem with earlier versions of NB but in
6.8m1 auto complete for $this->admin-> doesn't work. It should suggest
methods of class Admin
Am I missing something?
Pet
<mailto:address-removed>
<mailto:address-removed>
|
|
|
|
| Back to top |
|
 |
fortruth
Joined: 26 Aug 2008 Posts: 26
|
Posted: Fri Aug 21, 2009 12:21 am Post subject: autocomplete for class members |
|
|
I got it:
If you want to got the field from param. you must set fields to public.
this is the example worked at nb7.1
class Admin {
public $name;
function __construct() {
$this->name = "hello";
}
function setName($name) {
$this->name = $name;
}
}
class Hello {
private $admin;
public function __construct(Admin $myadmin) {
$this->admin = $myadmin;
$myadmin->name; //here it works
$this->admin->setName("hello"); //here it also works
}
}
2009/8/21 Pet <address-removed ([email]address-removed[/email])>
| Quote: | On Thu, Aug 20, 2009 at 5:01 PM, radek matous<address-removed ([email]address-removed[/email])> wrote:
|
| Back to top |
|
 |
radek matous Posted via mailing list.
|
Posted: Fri Aug 21, 2009 9:17 am Post subject: autocomplete for class members |
|
|
Pet wrote:
| Quote: | On Thu, Aug 20, 2009 at 5:01 PM, radek matous<address-removed> wrote:
| Quote: | 管俊明 wrote:
| Quote: | but I am using nb7.1 two sites all don't work.!!
| Use @property for fields, @var just for variables
|
still don't work, could you provide full example?
| class Admin {
function __construct() {
;
}
function myfnc() {
;
}
}
/**
* @property Admin $admin
*/
class AdminController {
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin->myfnc();
$this->admin->myfnc();
}
}
Might be broken in 6.8M1, but should work in current dev builds
Should work even without any special tag like @property (will be fixed +
additional tests will be added).
thanks
Radek
| Quote: |
| Quote: | Radek
| Quote: | 2009/8/20 Pet <address-removed <mailto:address-removed>>
class AdminController{
/* @var $admin Admin */
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin-> //here it will work
$this->admin-> //here it will not work
}
}
Hi,
I'm pretty sure it wasn't a problem with earlier versions of NB but in
6.8m1 auto complete for $this->admin-> doesn't work. It should suggest
methods of class Admin
Am I missing something?
Pet
<mailto:address-removed>
<mailto:address-removed>
|
|
|
|
|
| Back to top |
|
 |
Pet Posted via mailing list.
|
Posted: Fri Aug 21, 2009 9:41 am Post subject: autocomplete for class members |
|
|
On Fri, Aug 21, 2009 at 11:15 AM, radek matous<address-removed> wrote:
| Quote: | Pet wrote:
| Quote: |
On Thu, Aug 20, 2009 at 5:01 PM, radek matous<address-removed> wrote:
| Quote: |
管俊明 wrote:
| Quote: |
but I am using nb7.1 two sites all don't work.!!
|
Use @property for fields, @var just for variables
|
still don't work, could you provide full example?
|
class Admin {
function __construct() {
;
}
function myfnc() {
;
}
}
/**
* @property Admin $admin
*/
class AdminController {
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin->myfnc();
$this->admin->myfnc();
}
}
Might be broken in 6.8M1, but should work in current dev builds
Should work even without any special tag like @property (will be fixed +
additional tests will be added).
|
Glad to hear it, thanks!
| Quote: |
thanks
Radek
| Quote: |
| Quote: |
Radek
| Quote: |
2009/8/20 Pet <address-removed
<mailto:address-removed>>
class AdminController{
/* @var $admin Admin */
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin-> //here it will work
$this->admin-> //here it will not work
}
}
Hi,
I'm pretty sure it wasn't a problem with earlier versions of NB but in
6.8m1 auto complete for $this->admin-> doesn't work. It should suggest
methods of class Admin
Am I missing something?
Pet
<mailto:address-removed>
<mailto:address-removed>
|
|
|
|
|
|
| Back to top |
|
 |
radek matous Posted via mailing list.
|
Posted: Mon Aug 24, 2009 10:53 am Post subject: autocomplete for class members |
|
|
Pet wrote:
| Quote: | On Fri, Aug 21, 2009 at 11:15 AM, radek matous<address-removed> wrote:
| Quote: | Pet wrote:
| Quote: | On Thu, Aug 20, 2009 at 5:01 PM, radek matous<address-removed> wrote:
| Quote: | 管俊明 wrote:
| Quote: | but I am using nb7.1 two sites all don't work.!!
| Use @property for fields, @var just for variables
| still don't work, could you provide full example?
| class Admin {
function __construct() {
;
}
function myfnc() {
;
}
}
/**
* @property Admin $admin
*/
class AdminController {
private $admin = NULL;
public function __construct(Admin $admin) {
$this->admin = $admin;
$admin->myfnc();
$this->admin->myfnc();
}
}
Might be broken in 6.8M1, but should work in current dev builds
Should work even without any special tag like @property (will be fixed +
additional tests will be added).
|
Glad to hear it, thanks!
| BTW. my answer wasn't completely right. @property shows a "magic"
property, often coupled with impl. of function __get($var). @property
isn't suitable here because there is explicit declaration "private
$admin = NULL;" As I mentioned in this case shouldn't be necessary to
use neither @property nor @var (will be fixed).
But definitely not @property, rather @var. But be aware there are two
@var possible declarations that has different purposes. First is phpdoc @var
see
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.var.pkg.html.
Second is non phpdoc tag @var see
http://blogs.sun.com/netbeansphp/entry/defining_variable_type_in_a. In
the example above was chosen the wrong one
Radek |
|
| Back to top |
|
 |
|
|
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 can attach files in this forum You can download files in this forum
|
|
|
|
|