2013-09-21 45 views
2

我猜很多使用Dreamweaver作爲Laravel Blade的文本編輯器的人將面臨不支持的代碼/語法着色問題。沒有代碼着色,編碼很難閱讀。因此,我決定在Dreamweaver上做一些「黑客行爲」,以獲得Laravel Blade的代碼着色作品。要做到這一點,您需要轉到C:\ Program Files(x86)\ Adob​​e \ Adob​​e Dreamweaver CS6 \ configuration \ CodeColoring文件夾。然後,編輯php.xml文件。Laravel Blade的Adobe Dreamweaver代碼着色

添加以下的CodeColor_PHPScriptBlock

<blockStart doctypes="PHP_MySQL" scheme="customText"><![CDATA[{{]]></blockStart> 
<blockEnd><![CDATA[}}]]></blockEnd> 
<blockStart doctypes="PHP_MySQL" scheme="customText"><![CDATA[{{{]]></blockStart> 
<blockEnd><![CDATA[}}}]]></blockEnd> 

然後,添加以下的CodeColor_PHPScriptComment

<commentStart><![CDATA[--]]></commentStart> 
<commentEnd><![CDATA[--]]></commentEnd> 

下現在,你應該有代碼顏色和代碼提示工作。

但是,我仍然無法在Dreamweaver中獲得Blade語法着色作品。以下是仍然不起作用的語法:

@section 
@show 
@yield 
@extends 
@parent 
@stop 
@if 
@elseif 
@else 
@endif 
@unless 
@endunless 
@for 
@endfor 
@foreach 
@endforeach 
@while 
@endwhile 
@include 
@overwrite 
@lang 
@choice 

如果您知道如何在Dreamweaver中獲得上述語法着色作品,請與我分享。謝謝。

+4

我贊成使用他們喜歡的任何編輯器的程序員的我。也就是說,程序員通常會避免使用DW,因爲它只是一個簡單的文本編輯器的GUI編輯器。我建議切換到IDE,如NetBeans,Eclipse或PHPStorm。 – halfer

+0

您提到的哪一款IDE支持代碼着色和提示中的Laravel Blade? – user1995781

+0

我不知道,我不使用Laravel。他們是否是docblock式的評論?如果是這樣,NetBeans將對它們進行強化([請參閱此處](http://stackoverflow.com/q/4297629/472495)),但我不確定它們是否可以在NB中單獨重新着色。嘗試搜索「 docblock coloring」以查看是否可以找到任何內容。或者,可能有一個NB插件。 – halfer

回答

0

也許使用@作爲blockStart和)作爲blockEnd。問題是跟蹤開始和結束括號。

這是這裏的基本概念,在github.com/Medalink/laravel-blade(laravel-blade.tmLanguage):

<key>foldingStartMarker</key> 
<string>\@\b(section)\b(?=(|\s*|)\()</string> 
<key>foldingStopMarker</key> 
<string>\)(?!.*\))</string>