Let Textmate set *.php apart from *.css.php files, how?
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?
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.
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*/
.
精彩评论