Netbeans error in editor
r-da opened this issue · 5 comments
Hello,
I'm not sure this is a problem with Cakephp3 plugin, but I have the following issue.
If i have javascript code in a ctp file, marked with cakephp Html->scriptStart and scriptEnd, I have errors highlighted by netbeans (see attached screenshot).
Is there a way to avoid this and convince netbeans to parse the javascript correctly?
Unfortunately, it is not a bug. It is not a correct syntax of PHP. So the IDE recognizes it as an error.
But I may be able to improve it a bit. I cannot promise to do it soon, sorry.
So this means that it's not possible to instruct Netbeans that Html->scriptStart and scriptEnd are delimiters for javascript?
So this means that it's not possible to instruct Netbeans that Html->scriptStart and scriptEnd are delimiters for javascript?
Yes, users cannot do it by default. But as I wrote the above, maybe, it can be improved. (Sorry if it is not possible)
You can resolve that with this trick, at the end of the file put that
<?= $this->Html->scriptStart(['block' => true]); ?>
/*<script>*/
[insert you code here]
<?= $this->Html->scriptEnd(); ?>