views:

77

answers:

1

Does anybody know an PHP IDE that features a tool to encapsulate private variables, as Visual Studio does for C#/VB/etc? In fact any IDEs that support PHP and include code-generation tools would be of interest.

+2  A: 

Hi Alex,

yes and no ;)

There are IDEs that support code generation of getter and setter methods. For example the commercial Zend Studio for Eclipse and the free Aptana Studio with PHP Plugin. In fact this is a bit different to the encapsulation in C#, as you won't get this:

private String _name;



    public String Name

    {

        get { return _name; }

        set { _name = value; }

    }

but something this:

<?php

class sample 
{
protected $myMember;

public function getMyMember()
{
    return $this->myMember;
}

public function setMyMember($myMember)
{
    $this->myMember = $myMember;
}
}
?>

Hope this helps a bit.

Regards, Mario

Mario Mueller