让 Textmate 将 *.php 与 *.css.php 文件分开,如何?

发布于 2024-11-27 03:26:40 字数 310 浏览 2 评论 0原文

我正在使用动态生成的 CSS 文件。 为了让 Apache 知道,它们必须经过预处理,它们必须以

.php

现在问题是:

Textmate 无法辨别/区分 *.css.php 和 *.php。当我将 .css.php 文件设置为 CSS 标记时,我的其他 .php 文件也设置为 CSS 标记。

例如,.html 文件仍然由捆绑包编辑器中定义的关联 .html-language-preferences 进行标记。

有没有办法不完全重写 PHP MarkUp 定义?

I am working with dynamic generated CSS files.
To let Apache know, they have to be preprocessed, they have to end with

.php

Now here is the Problem:

Textmate won't discern / differ between *.css.php and *.php. When i set the .css.php file to the CSS MarkUp, my other .php files are also set to CSS MarkUp.

.html files for example, are still MarkedUp by the associated .html-language-preferences defined in the bundle editor.

Is there a way to not completely rewrite the PHP MarkUp definition?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与酒说心事 2024-12-04 03:26:40

如果您只需要处理几个 .css.php 文件,您只需在窗口底部的语言菜单中选择 CSS。

如果您能够编辑您的 Apache 配置,我建议您添加/编辑此行(从内存中,因此请检查之前的文档):

AddType application/x-httpd-php .php .css

通过此操作,您可以让 TextMate 正常打开 .css 文件并由 PHP 处理,就好像它们是 .css 文件一样。 php。

If you only have to deal with a few .css.php files you only have to choose CSS in the language menu at the bottom of the window.

If you are able to edit your Apache configuration I'd suggest you add/edit this line (from memory so check the docs before):

AddType application/x-httpd-php .php .css

With this you can have .css files opened normally by TextMate AND processed by PHP as if they were .php.

你不是我要的菜∠ 2024-12-04 03:26:40

我通过以下方式增强了 PHP 语言包:

{
    name = 'css.embedded.block.html';
    begin = '(/\*CSS)';
    end = '(CSS\*/)';
    patterns = ( { include = 'source.css'; } );
},

在模式部分中,但现在 .css.php 文件中的 CSS 代码必须以 /*CSS 开头并以 CSS*/ 结尾

I have enhanced the PHP language bundle by:

{
    name = 'css.embedded.block.html';
    begin = '(/\*CSS)';
    end = '(CSS\*/)';
    patterns = ( { include = 'source.css'; } );
},

in the patterns section, but now the CSS code in the .css.php-files have to start with /*CSS and end with CSS*/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文