Symfony Support in NetBeans

v. draft 0.0.1

This document is in progress

This document describes how the support of Symfony PHP framework in NetBeans should be done. The work on this document is in progress and it's not final. All the features mentioned here, doesn't have to be implemented in the first version of support. The primary goal of this document is clarifying, what the support should contain, describe usecases, when the features will be helpful etc.



Symfony framework defines folder structure for the project. NetBeans has to support existing projects based on this framework or should be able to create new php projects with the framework. The support will not allow to extend an existing project with Symfony.

Q1: Is this limitation ok? Is there any usecase when user needs to extend an existing project with Symfony framework?

Opening existing projects based on Symfony

Usecase: User has an project based on Symfony and wants to use NetBeans for working with this project.

The support will not handle this situation. User can use the current wizard for creating new PHP Application with Existing Sources. As the source folder user needs to choose the folder, where are all the folders like apps, cache, config, data etc are located. The Symfony specific functionality will be automatically offered by the support, which needs to recognized that the created php project is Symfony based. User has to select the web folder as the Web Root in project properties.

Q2: How the support can recognized that the project is based on Symfony? Is it just on the folder structure? Is there another identifier?

  • Every symfony project has a file named symfony in it's root. And you could detect it from the folder structure (but this can be changed)
  • you can also get framework version by executing cli vith -V parameter ( because versions have some differences - cli tasks, configuration etc )

TMYSIK: currently based on folder structure

Q3: When the project from existing folder is instantiated, could the project wizard ask the framework providers, whether they want to alter the setup of the project?

TMYSIK: I don't think so.

Create new PHP application with Symfony

The support should contain two ways how to create new Symfony based projects. The first one will use the sf-sandbox project, the second one will generate new project trough the Symfony CLI.

Usecase 1: User wants to create new php project, which is Symfony based, but there is not installed Symfony on the local machine.

The support will register project wizard, which creates new php project and then unzip into the source folder. The web folder is set up as the Web Root and the symfony/symfony.bat from sf-sandbox is set up as the Symfony CLI script for this project (see the Options section).

The php distribution will not include a sf-sandbox zip file. The main reason is that the the zip file has almost 3 MB. It can be provided through a wrapper module on Update Center or user can point out already downloaded zip file. The wizard will offer option to download the file from Symfony project pages or from our Update Center.

Q4: Is there known problem to use symfony CLI script from sf-sandbox. Are there any limitation?

  • only limitations are:
  • current dir when executing cli script must be symfony project root

TMYSIK: currently not supported and no such plans (only Usecase 2 possible)

Usecase 2: User want to create new php project based on Symfony and there is Symfony installed on the local machine.

This wizard will create new php project and call Symfony CLI to generate new project. There has to be specified path to Symfony CLI script. Wizard will offer the already used path or user can select new one. The wizard will create the project in these steps:

  • create new PHP project without the index.php
  • executing symfony generate:project ${name_of_project}
  • executing symfony generate:app ${name_of_app}

The variable ${name_of_project} will be the name of the NetBeans project. The wizard asks also about the name of the first application. The default value will be frontend.

Q5: What should be the URL of the project? How user will configure Apache server for running the project?

  • when generate:project is run it creates Apache vhost config file in config/ folder. in it the default url ( when this file is activated in apache) is projectname.localhost ( in this case name of the NetBeans project)

Editor & Project

  • @method
  • add support for @method IZ 168277
  • add hint for generating @method for columns for DB schema files - not needed, see ticket
  • navigation
  • navigate from action to view and vice versa
  • add hint for generating new view (is it possible via symfony? or just an empty PHP file is enough?)
  • view
  • add default varibles to code completion for views ($sf_user, $sf_request, $sf_response)
  • add class fields to code completion ($this->form in action available as $form in view) [[[partlyCanBeSolvedBy@propertyButNotMethodSpecific,OnlyClassSpecific | [partly can be solved by @property but not method specific, only class specific]]]
  • YAML
  • do not fail if PHP code is present IZ 168497
  • hints
  • see above
  • more to come
  • Projects view
  • custom icons for applications, modules, ...
  • Tasks
  • shortcuts to tasks that doesn't require parameters (freeze, unfreeze...).
Not logged in. Log in, Register

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