Php 如何在PDT Helios中自动格式化代码文件*.ctp?

Php 如何在PDT Helios中自动格式化代码文件*.ctp?,php,eclipse,cakephp,eclipse-pdt,Php,Eclipse,Cakephp,Eclipse Pdt,我正在使用Eclipse for PHP(PDT)Helios,如何自动格式化CakePHP模板文件?例如:当我跟随时,当我编辑文件index.ctp时,如下所示: <!-- File: /app/View/Posts/index.ctp --> <h1>Blog posts</h1> <table> <tr> <th>Id</th> <th>Title<

我正在使用Eclipse for PHP(PDT)Helios,如何自动格式化
CakePHP模板文件


例如:当我跟随时,当我编辑文件
index.ctp时,如下所示:

<!-- File: /app/View/Posts/index.ctp -->

<h1>Blog posts</h1>
<table>
    <tr>
        <th>Id</th>
        <th>Title</th>
        <th>Created</th>
    </tr>

    <!-- Here is where we loop through our $posts array, printing out post info -->

    <?php foreach ($posts as $post): ?>
    <tr>
        <td><?php echo $post['Post']['id']; ?></td>
        <td>
            <?php echo $this->Html->link($post['Post']['title'],
array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?>
        </td>
        <td><?php echo $post['Post']['created']; ?></td>
    </tr>
    <?php endforeach; ?>
    <?php unset($post); ?>
</table>

博客帖子
身份证件
标题
创建
我不理解Eclipse如何自动格式化上面的代码片段。请帮帮我,谢谢

在Aptana Studio(基于Eclipse)中,尝试以下操作:

Window / Preferences / General / Editors / File Associations

如果您没有.ctp文件,则必须将其添加到该扩展名
关联文件
到PHP

之后,我会像下面的屏幕截图一样执行此操作:


这不是编码相关的问题,你应该问
如何在Eclipse中格式化???
亲爱的朋友,@jQueryAngryBird,我不这么认为。如果我的问题不好,让我们修改一下。