getting your IDE to recognize javascript in .phtml files

Yesterday, our project lead came up with a clever hack to get the IDE to apply recognize Javascript in .phtml files.

Our project uses a lot of .phtml that emits javascript fragments that are not surrounded by <script> tags. To get our IDE (NetBeans) to treat these as Javascript, we added the following PHP fragments at the top & bottom of the files:

<? if (false) { ?><script language='javascript'> <? } ?>

If you wanted to buy generic levitra get great response than you have to implement healthy changes too. But researchers and modern technology have found it cheap viagra discount as myth. viagra sildenafil Weighted Therapy solutions: Weighted therapy is also in crisis at the present time. By taking this medicine, the symptoms and the reappearance of pain was lessened to a cheapest levitra prices great amount.

... CODE HERE...
<? if (false) { ?></script><? } ?>

Of course this is kind of a hack, but it’s pretty useful!

Leave a Reply

Your email address will not be published. Required fields are marked *