Development

SymfonyAndPDT

You must first sign up to be able to contribute.

Version 13 (modified by naholyr, 10 years ago)
Add tip about Code completion and Propel

  1. Features
  2. Using PDT with Symfony
    1. Get Symfony Code Completion in PDT
    2. Method 1: Add the Symfony project as a Library
    3. Method 2: Create virtual folder that points to Symfony libraries
  3. Highlight code syntax for YAML
    1. Add SVN project using PDT
  4. FAQ
    1. Change PDT Font
    2. Tip : Code completion & Propel
  5. Screencaps
    1. Code Folding (with preview)
    2. Code completion
    3. File explorer class inspection + svn

Features

  • Code Completion
  • Templates
  • File/Project Class Inspection in File Explorer
  • Code Folding

PDT Home

Using PDT with Symfony

Get Symfony Code Completion in PDT

There are two ways to do it.

Method 1: Add the Symfony project as a Library

  1. Open the PHP Navigator
  2. Right-click on your project
  3. Select "Configure Include Path"
  4. Select the "Libraries" tab
  5. Click "Add External Folder"
  6. Navigate to "\route\to\PEAR\symfony"
  7. Click "OK"

Note If the Libraries are not visible in step 4, a minor configuration issue may be caused by an SVN plugin. Follow the instructions at this link: HOWTO Use Eclipse with Subversion

Method 2: Create virtual folder that points to Symfony libraries

If you want to navigate and explore Symfony code during development (for example, navigate from sfWebRequest to sfRequest class via Ctrl-clicking class name), you may add "/route/to/PEAR/symfony" directory as a virtual folder instead of adding it as a library.

  • Right-click lib folder of your project
  • Select New->Folder
  • Enter "symfony" as folder name
  • Click "Advanced"
  • Tick "Link to folder in the filesystem"
  • Locate directory with symfony libs with "Browse..." button
  • Click "Finish"

Highlight code syntax for YAML

YAML Editor plugin

Add SVN project using PDT

Install Subclipse

Following SVN guidelines for creating a new project location

Find files/folders on svn:ignore and copy them to another folder

  • Files/folders that are usually on svn:ignore
    • project/cache
    • project/log
  • Open Eclipse SVN repo view
  • Right click on desired project/trunk folder
  • Select Checkout
  • Change name from 'trunk' to project name
  • Designate project location(e.g. \project\directory )
    • Project will checkout to location\projectName, so do not specify the project name in workspace location or you'll end up with location\projectName\projectName
  • Replace all files on svn:ignore
  • Add eclipse project files/folders to svn:ignore
    • .project .projectOptions /.cache /.settings
  • Set permissions on cache and log folders to full for Users

oh, but you're not done yet.

now the subclipse project works in eclipse, but most PDT functions (code folding, snippets), don't! to fix:

  1. delete the project from eclipse. BE SURE that "delete project only" is checked (don't delete the project files).
  2. manually delete the .project file from the directory.
  3. add a new PHP Project in eclipse, pointing it at the same spot as before.

now you have both subversion icons/functionality, and PDT functionality.

FAQ

Change PDT Font

Changing the PDT font is kind of counter-intuitive, as it is inherited from the default font. To change:

Window->Preferences->General->Appearance->Colors and Fonts->Basic->Text Font

Tip : Code completion & Propel

When you type $object = MyClassPeer::doSelectOne($criteria); $object-> you would like to view the list of MyClass methods, but nothing happens ?

This is normal, with default configuration, classes generated by Propel do not have doc-comments, so Eclipse cannot guess the return-type, and cannot offer code completion.

To enable doc-comments in Propel-generated classes, just edit config/propel.ini and find the following line (or add it to the end if you cannot find it) :

  propel.builder.addComments = false

And change its value to "true".

Screencaps

Code Folding (with preview)

Code completion

File explorer class inspection + svn

Attachments