使用CodeKit和haml/PHP [英] Working with CodeKit and haml/PHP

查看:87
本文介绍了使用CodeKit和haml/PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的最新项目中,我使用了Rails.现在,我必须在PHP中做一些事情(我实际上讨厌或太喜欢Ruby语法).

in my latests projects I have use Rails. Now I have to do something in PHP (which I actually hate, or love too much Ruby syntax).

所以现在我非常习惯与Sass和haml一起工作,我也很喜欢.因此,我购买了 CodeKit 用于在Rails框架之外进行操作.

So now I am very used to work with Sass and haml, which I also love. So I bought CodeKit for doing things outside rails framework.

只想知道是否有在PHP文件中使用haml或在haml文件中使用PHP的选项,并且该文件可以使用CodeKit编译,甚至可以使用PHP.

Wanted just to know if there is any option for use haml in PHP files, or PHP in haml files, and that the file compiles with CodeKit, even having PHP.

推荐答案

您可以使用:plain过滤器保存php,它不会解析过滤的文本.当您需要保留多行php时,这很有用.

You can use the :plain filter to preserve the php, it does not parse the filtered text. This is useful when you need to keep multiple lines of php.

例如:

:plain
  <?php foreach ($es as $e) {
    echo $e;
  } ?>

我还没有听说过Sublime Text 2的任何haml/php颜色语法.

I have not heard about any haml/php color syntax for Sublime Text 2 yet.

还有另一个对使用php有用的设置:在Codekit的HAML配置中检查不要转义HTML"字符: http://d.pr/i/4pmv

There is another setting that can be useful for working with php : check the don't escape HTML character in the HAML config on Codekit : http://d.pr/i/4pmv

这可以解决

%form#booking_log{:name => "booking_log", :method => "post", :action => "<?=$this->action('bookingGetLog')?>"}

这篇关于使用CodeKit和haml/PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆