Reputation: 2923
I want to create a new Class in Symfony Eclipse. The namespace should automatically be added to the file.
I saw this here. But I can't create a 'PHP Class'. I can choose between 'PHP File' and 'Untitled PHP File'. But these guys don't automatically create the namespace.
Has this something to do with the PDT Plugin? I can't install it from the Eclipse Marketplace, because of some missing stuff..
Thank you :D
Upvotes: 2
Views: 614
Reputation: 616
Christoph, the IDE that you reference in the video is not Eclipse, but it is phpstorm. And yes, it is a really amazing IDE. I think it is way way way better than eclipse pdt, but like many other great things in life it's not free (but you can use it for free at least for the 30 days trial), but if you don't have the money or you don't want to pay $99 for a personal license, you can use eclipse code templates to do something similar. Take a look at this tutorial.
Anyway here is an example:
namespace ${namespace};
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
*
*
* @author ${user}
*/
class ${class_name} extends Controller {
public function indexAction() {
${cursor};
}
}
Upvotes: 1