public function save($con = null) { //Do the main save to get an ID $user = parent::save($con); //Add the user to the relevant group, for permissions and authentication if (!$user->hasGroup('Dispatchers')) { $user->addGroupByName('Dispatchers'); $user->save(); } return $user; }
Tuesday, April 17, 2012
Add Group to User Automatically when Creating a New User with Form
Add this to the form...
Labels:
form,
sfDoctrineGuard,
symfony,
user
Friday, April 13, 2012
Tuesday, April 10, 2012
Customize Zend Studio
Disable AltGr + N to create a New Document
Windows / Customize Perspective -> Command Groups Availability -> uncheck New PHP Document.
To open a file by double-clicking in Zend Studio, not in external editor
Add the file type to the list of file types which will automatically be opened in Zend Studio by doing the following:
Windows / Customize Perspective -> Command Groups Availability -> uncheck New PHP Document.
To open a file by double-clicking in Zend Studio, not in external editor
Add the file type to the list of file types which will automatically be opened in Zend Studio by doing the following:
- From Zend Studio 's Menu Bar, go to Window | Preferences | General | Content Types.
- The Content Types dialog will be displayed.
- Select Text | PHP Content Type from the list.
- A list of file types associated with Zend Studio will be displayed.
- Click Add to add your file's type to the list, Enter the file type (e.g. .php) and click OK.
- The file type will be added to the list.
Encoding / character set + Line delimiter:
Window / Preferences -> General -> Workspace -> Text file encoding -> UTF-8
+
New text file line delimiter
Remove trailing whitespace:
Window / Preferences -> PHP -> Editor -> Save Actions -> Remove trailing whitespace
Ctrl + TAB to the next file
Windows / Preferences -> General -> Keys
Search for: Previous Editor, Next Editor...
Default indentation for array initializers
Window / Preferences -> General -> Workspace -> Text file encoding -> UTF-8
+
New text file line delimiter
Remove trailing whitespace:
Window / Preferences -> PHP -> Editor -> Save Actions -> Remove trailing whitespace
Ctrl + TAB to the next file
Windows / Preferences -> General -> Keys
Search for: Previous Editor, Next Editor...
Default indentation for array initializers
Window > Preferences > PHP > Code Style > Formatter > Edit... > Line Wrapping
Set Default indentation for array initializers to 0.
Mark Occurrences
Windows / Preferences -> PHP -> Editor -> Mark Occurrences
Labels:
customization,
zend studio
Subscribe to:
Posts (Atom)