Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Parse snippets inside of <?php ?> -tags? #55

Closed
circlewaves opened this issue Jul 25, 2014 · 3 comments
Closed

Parse snippets inside of <?php ?> -tags? #55

circlewaves opened this issue Jul 25, 2014 · 3 comments

Comments

@circlewaves
Copy link

Hello,

I try to add some custom php-snippets, but for some reason it doesn't work inside of php-tags.
For example, I have json file with my custom-snippets (file snippets-php.json):

{
"html": {
"snippets": {
"mysnippet": "Some text goes here",
}
}
}

This snippet works fine if I try to expand "mysnippet" outside of php-tags, but inside of php tags "mysnippet" just converts into , for example file index.php:

mysnippet // this converts into "Some text goes here"

?>

I have tried a lot of solutions, but unfortunately, without success, e.g.

{
"php": {
"snippets": {
"mysnippet": "Some text goes here",
}
}
}

Could someone help me?

Thanks in advance!

@sergeche
Copy link
Member

For some reason, Brackets identifies PHP-syntax as clike.

So, you should use your latter example to create PHP snippets, but use clike instead of php:

{
    "clike": {
        "snippets": {
            "mysnippet": "Some text goes here",
        }
    }
}

@circlewaves
Copy link
Author

It work fine, many thanks for this advice! :)

@wonkler
Copy link

wonkler commented Apr 12, 2015

@sergeche Do you know how Brackets identifies JavaScript syntax in this case?

I have tried the following to add JS snippets with no luck:

{
    "js": {
        "snippets": {
            "mysnippet": "Some text goes here"
        }
    }
}

Also,

{
    "javascript": {
        "snippets": {
            "mysnippet": "Some text goes here"
        }
    }
}

Any solution would be very appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants