Overview
KB
Learn PHP
PHP techniques
PHP Smarty Functions
PHP Web Email
Secure development
PHP Security Scenario
SSH and SFTP
PHP Smarty
PHP Smarty Modifiers
PHP Smarty Caching
PHP Smarty Misc
CakePHP
Zend Framework
PHP basics

CakePHP Development

Editing CakePHP view files

Special note should be made about CakePHP view files - those with .thtml extension. As any editor would PhpED determines which syntax color highlighting to use based on the extension of the file. To turn on PHP syntax highlighter for .thtml files, you can:
  • Open Tools->Settings dialog
  • Select IDE->Associations and add *.thtml extension to the list handled by PHP, as shown here:
CakePHP Edit .thtml view files

This will tell PhpED to treat .thtml files as PHP files (you can choose HTML instead, it is the matter of personal preferences) and make working with CakePHP view files quite easy. But what about code insight?

Using Code Insight with CakePHP view files and $html variable

Code completion and hints for php functions and variable hints will just work if you associate .thtml files with PHP in Tools->Settings->Associations. To take advantage of the full power of PhpED's code insight, make sure that you looked at PHP Code Completion tools section of our website. One feature deserves a special mention here, namely getting Code Completion to work with $html variable.

As we learn from the 15 minutes CakePHP Blog tutorial, $html variable plays a special role in view .thtml files because it is an instance of HtmlHelper class.
To make sure that code completion shows all methods of HtmlHelper class you can follow the simple technique described in PhpDoc for PHP Type Hints document. For getting help with $html you can simply add the following to your .thtml files:
<?php 
/** 
* @var HtmlHelper $html 
*/ 
?>
This will do the magic:
CakePHP .thtml type hints

NuSphere PHP Editor will take care of everything else and before long you will be able to see your CakePHP blog at work in PhpED's PHP VIewer: CakePHP PHP Viewer


Article continues:  <<previous page  next page>>

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 21.0 is available from our online store front.

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 21.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com