Emacs + CakePHP

Given that Emacs and CakePHP are installed on Ubuntu 7.10. At first, Emacs does not high-light php code and also php template that are used in CakePHP.  So I installed php-mode by this command:

aptitude install php-mode

Then I can edit php code with syntax highlighting. However tab-size for CakePHP source code seem to be 4 but Emacs default is 8. So I add these to the file .emacs:

(setq default-tab-width 4)

(setq c-basic-offset 4)

Even .php files are highlighted but .ctp files, which is template, are not highlighted. So I add file-mode association list by editting .emacs again:

 (setq auto-mode-alist
(cons ‘(“\\.ctp$” . php-mode)
auto-mode-alist))

emacs_cakephp.png

I hope these modifications are adequate for developing software with CakePHP and Emacs.🙂

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s