Search code examples
phpcsstextmatetextmatebundlesdynamic-css

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?


Solution

  • 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*/.