netbeans-php-blade-plugin
netbeans-php-blade-plugin copied to clipboard
Netbeans 18+ module plugin for php blade template files
Netbeans Php blade editor
Netbeans Php blade editor using Antlr Lexer and Parser.
[!NOTE] This is an extract of a new netbeans modules suite : https://github.com/haidubogdan/nb-18-php-blade-plugin still in development.
Installation
Requirements
Installing from package
The plugin is not uploaded on netbeans site as it is still in experimental version.
Check for relase versions at : https://github.com/haidubogdan/netbeans-php-blade-plugin/tags
- In Netbeans open Tools -> Plugins, select Downloaded tab.
- Click "Add plugins" and select the file from the nbm folder.
- Select the checkbox next to the "Blade for Netbeans" plugin and click Install.
- Restart the IDE when demanded and enjoy your new plugin.
Installing from source
- Clone the git repository.
- Start a new Netbeans project, choose NetBeans module as project type.
- Setup your project.
- Right-click on project name and choose Create NBM.
- Install the NBM file as described in "Installing from package".
For more information refer yourself to: http://platform.netbeans.org/tutorials/nbm-google.html
Usage
Features
- Blade syntax coloring
- Declaration finder for
- php elements
- included paths
- yield ids (section)
- stack elements
- Php code completion inside expressions, and echo tags
- Brace matcher and folding
- Find template usage (only in the blade files context)
Custom directives
Project -> Properties -> Laravel Blade -> Custom Directives
Just add the php file where you added the custom directive implementation as in https://laravel.com/docs/10.x/blade#extending-blade.
VIews folder
If you use blade templates outside of the generic laravel framework or have custom templates folders you can configure them for a project.
This will help the yielid and view path completion
Reformat and indentation
Experimental formatting and indenting
Known issues
[!WARNING] .
- The duplicate file process can create a "blade_1.php" file because by default the extension of a file is the last ".*" element. So for "blade.php" the extension found is ".php"
- HTML join embedding breaks indentation especially in
<script>
and<style>
context
brace matcher
- Emoji character can break brace matching.
completion
- slowness or process is stuck
Why Netbeans 18+ requirement ?
The plugin is implemented using ANTLR lexer and parser. I migrated from Jflex and jcup tools due to scalability reason. Antlr plugin was introduced with Netbeans 18.
Still missing
Some features are not implemented in this plugin version :
- variable completion from controller
- components completion and declaration finder
- error diagnostics for inline php code