Development practices
(1) Do not use super global variable $_get,$_post,$_request,$_files,$_server,
Use Jinput instead, jfactory::getapplication ()->input
(2) Do not write native SQL queries, use Jdatabase/jdatabasequery instead,
Jfactory::getdbo ()->getquery (true);
(3) Do not provide the entrance, using components or plug-in instead.
(4) Do not create wheels repeatedly.
(5) The use of meaningful prefixes is most indicative
(6) Convert external input using Jtext.
Where the javascript,css,image under its own component should be placed.
As you see, jpath_root/media/com_name can store all these files. Asset directories under their own components can also be stored.
Where the component-generated files are placed
Temporary files, the Web server cannot be accessed, Jfactory::getconfig ()->get (' Tmp_path ') do not use Jpath_root. ' /tmp '
Cache file, Web server not accessible, Jpath_cache
cache files, Web server can access, media/subdirectories
Persistent files, the Web server cannot be accessed, placed in a subdirectory of the component, and given a. htaccess file
Persistent files, Web server accessible, media/subdirectories
If you want to manage logs using the Jlog class
About JavaScript
(1) End with a semicolon and another line
(2) Ensure that your code is valid and does not throw errors
(3) using Try/catch
(4) write the JS code in the file in the Tmpl directory, not in the View class (view.html.php)
(5) Do not modify the native code, if you want to do it, create a subclass
(6) Do not modify the code of other programmers
2.0 Development Conventions