PHP-Mode
Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Customization

This chapter describes the differents parameters and functions that you can change to customize PHP Mode. To do that, open a PHP file, click on the PHP menu and choose Options then Browse Options....


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Parameters


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.1 Mode

PHP Mode has 3 modes allowing to simplify the writing of PHP code. You can enable/disable each mode individually.

`php-electric-mode'

Type: boolean
Default value: `t'
Description: If `t'; enable automatic generation of template. If `nil'; template generators can still be invoked through key bindings and menu. Is indicated in the modeline by "/e" after the mode name and can be toggled by `php-electric-mode'.

`php-stutter-mode'

Type: boolean
Default value: `t'
Description: If `t'; enable the stuttering. Is indicated in the modeline by "/s" after the mode name and can be toggled by `php-stutter-mode'.

`php-indent-tabs-mode'

Type: boolean
Default value: `nil'
Description: If `t'; indentation is made with tabs. If `nil'; indentation is made with spaces.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.2 Menu

PHP Mode has also 2 menus tha you can enable/disable. The menus Index and Sources are specific to each PHP files opened.

`php-index-menu'

Type: boolean
Default value: `t'
Description: If `t'; the Index menu is enabled. It shows the list of class and functions of the opened file. The Index menu scans the file when it is opened.

`php-index-menu-auto-rescan'

Type: boolean
Default value: `t'
Description: If `t'; the Index menu is updated when a function or a class is added or removed.

`php-source-file-menu'

Type: boolean
Default value: `t'
Description: If `t'; the Sources menu is enabled. This menu contains the list of PHP file located in the current directory. The Sources menu scans the directory when a file is opened.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.3 Templates

`php-include-in-parenthesis'

Type: boolean
Default value: `t'
Description: If `t'; the include et require functions are used with parenthesis (example : require( 'required_file.php' );). If `nil'; the include and require functions are used without parenthesis (example : include_once 'required_file.php';)

`php-add-fclose-with-fopen'

Type: boolean
Default value: `t'
Description: If `t'; the fclose function is added when the template of the fopen function is executed.

`php-add-mysql-close-when-connect'

Type: boolean
Default value: `t'
Description: If `t'; the mysql_close function is added when the template of mysql_connect function is executed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.3.1 Header

`php-file-header'

Type: string
Default value: `"
/**
* <description string>
*
*
* Created: <date>
* Last update: <date>
*
* @link <link string>
* @copyright <copyright>
* @author <author>
* @package <package string>
* @version <version string>
*/

<cursor>"'

Description: String or file to insert as file header. If the string specifies an existing file name the contents of the file is inserted; otherwise the string itself is inserted as file header.
Type `C-j' for newlines.

The follonwing keywords are supported:
<filename>: replaced by the file name.
<author>: replaced by the user name and email address.
<login>: replaced by `user-login-name'.
<company>: replaced by `php-company-name' content.
<date>: replaced by the current date.
<year>: replaced by the current year.
<copyright>: replaced by `php-copyright-string' content.
<cursor>: final cursor position.

`php-file-footer'

Type: string
Default value: `""'
Description: String or file to insert as file footer. See `php-file-header'

`php-company-name'

Type: string
Default value: `""'
Description: Name of the company to insert in file header.

`php-copyright-string'

Type: string
Default value: `""'
Description: Coryright string to insert in file header.

`php-date-format'

Type: string
Default value: `"%Y-%m-%d"'
Description: Date format.

`php-modify-date-prefix-string'

Type: string
Default value: `" * Last update: "'
Description: Prefix string of modification date in PHP file header.

`php-modify-date-on-saving'

Type: bool
Default value: `t'
Description: If `t'; update the modification date when the buffer is saved.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.4 Style

`php-basic-offset'

Type: integer
Default value: `4'
Description: Amount of basic offset used for indentation.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.5 PHPDocumentor

`php-enable-phpdocumentor-tags'

Type: bool
Default value: `t'
Description: If `t'; PHP-Documentor tags are added into the class and functions comments.

`php-class-tags'

Type: list (string)
Default value: `'("package")'
Description: List of PHP-Documentor tags to add into the class comments.

`php-function-tags'

Type: list (string)
Default value: `'()'
Description: List of PHP-Documentor tags to add into the functions comments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.6 Miscellaneous

`php-intelligent-tab'

Type: bool
Default value: `t'
Description: If `t'; TAB does indentation; completion and insert tabulations. If `nil'; TAB does only indentation.

`php-word-completion-in-minibuffer'

Type: bool
Default value: `t'
Description: If `t'; enable completion in the minibuffer.

`php-word-completion-case-sensitive'

Type: bool
Default value: `nil'
Description: If `t'; completion is case sensitive.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Functions


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.1 Mode

`php-electric-mode'

Menu: PHP -> Options -> Mode -> Electric Mode
Keybinding: C-c C-m C-e
Description: This functions is used to enable/disable the electric mode.

`php-stutter-mode'

Menu: PHP -> Options -> Mode -> Stutter Mode
Keybinding: C-c C-m C-s
Description: This function is used to enable/disable the stutter mode.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]