Is there any way to configure properly, or turn off all together, the autocomplete/intellisense when coding HTML in a .php or .phtml file? For example, any time I try to close any element it starts suggesting PHP things like $_COOKIE or constantly trying to close a not even open <?php tag.
You can set "php.suggest.basic": false and then install a PHP extension to provide intellisense. I recommend this.
*Disclaimer - I'm the author
Related
When working with pthml file, how do I get the HTML-Intellisense like I got when working with html file?
I have the extension PHP Intelephense installed, but it's not recommending the closing tag when adding new HTML tag. Or did I configured something wrongly?
Edited:
VS Code can do this by altering the setting file association. So if I associate the phtml file with html, I get the Intellisense for html, and the same for php. I think what I really want is to associate phtml with html and php... which is impossible for now, I guess.
For reference: https://github.com/Microsoft/vscode/issues/22415
Try:
"files.associations": {
"*.phtml": "html"
}
in your settings file. This should give .phtml files the same intellisense as html files.
I have written an extension with a html template. Inside that html template there is php code. That php code dynamically generates some DOM elements depending on files and folders in fileadmin! Now if I change files and folders in fileadmin and THEN go to my website, the html template of my extension hasn't changed. That means the DOM elements are still the same. Thus the php code hasn't been executed again and typo3 must have used some cached version of my html template. Where can I configure that behaviour and force typo3 to always recalculate my html template (meaning: execute the php code in it!)?
As you have mentioned: TYPO3 uses a lot of caches.
And if something depends on external activities it should be uncached on all levels.
So you need to declare your plugin uncached.
you have not explained what kind of template you use. In case of Fluid templates you might use uncached partials and viewhelpers.
I would like to edit file.html with javascript mark ups? Simple open my .html file as .js file.
Go to Tools|Options -> Miscellaneous|Files and for File Extension html change Associated mime type to text/javascript
The answer is yes you probably can, but why would you want to edit an HTML file with Javascript markups/syntax highlighting? Whilst there is nothing preventing you doing it, it is not really good practise to have any significant amount of Javascript in an HTML file, so if you have a large amount it should be in a separate .js file
I'm using NetBeans 7.2.1 for my developments with CodeIgniter/Bonfire.
In my controllers i'm loading my for the view needed JavaScripts via
Assets::add_js($this->load->view('admin/index_js', $data, true), 'inline');
to preparse some php variables in the JavaScript (like dynamic url's).
This forces me to save these JavaScript files witht he extension ".php" so that i can load it via
$this->load->view
All these JavaScript files are using the filename syntac
*_js.php
Since i load it via view and Assets with "inline" parameter i can't put the
<script>
</script>
tags in the script so NetBeans is not recognizing it as JavaScript and i have no syntax highlightning and no formatting options.
Any idea how i can get it that NetBeans can recognize it as JavaScript?
Thanks a lot.
Okay... got it...
One of my collegues made a change to the assets library to "erase" the script tags from assets::js inline included files:
http://forums.cibonfire.com/discussion/1134/assetsjs-inline_js-change-to-load-js-via-view#Item_1
I use Microsoft WebMatrix as an HTML editor. Unfortunately, it doesn't recognize .phtml files used in Zend Framework by default. What can I do to change the default file extension to .php for all files in a project?
Put something like:
$view = new Zend_View();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->setView($view)
->setViewSuffix('php');
In your bootstrap. But there must be a way to tell your editor to use phtml its sad to have to change stuff just to acomodate a editor.
ps: not tested not close to a editor but it should work.
Netbeans for php is a good alternative. .phtml are fully supported. I am using netbeans for my ZF application since last 2-3 years. works like a charm!!
check this page https://netbeans.org/features/php/