How to Create a .blade.php file type

Blade requires a .PHP extension, and so Storm gives you a file with PHP tags and formating.

However, blade files are really formatted as HTML pages. So currently, I have go to the hassel of everytime I create a blade file, closing the PHP tag and them starting with <!doctype html>  

I would like to create a .blade.php file type which does not have the PHP tags on it and automatically goes straight to html.

How do I do that ?

Many thanks !

3 comments
Comment actions Permalink

Hi there,

"File | New | File" (when invoked from project view) and type full file name with extension (e.g. "file.blade.php") ?

This will create you an empty file with nothing inside it.

-----

You could also go and create custom file template with desired content (Setting | File and Code Templates)
1) Create new file template (use "php" as extension) with your content
2) Now you can use in "File | New" -- just choose your template
3) NOTE: the file name for new file should contain ".blade" part (e.g. "file.blade") as file templates mechanism does not support templates with complex extensions.
4) Once created, the ".php" part will be added automatically: "file.blade.php")

0
Comment actions Permalink

Ok - that's great. I created a live template for blade. However, now I want to able to reformat the code my blade file by applying the formating rules for HTML.

How do I do that ?

Many thanks !!

0
Comment actions Permalink

Code reformat for blade files is not yet supported

https://youtrack.jetbrains.com/issue/WI-24357

0

Please sign in to leave a comment.