Home >Backend Development >PHP Tutorial >Joomla secondary development study notes, joomla study notes_PHP tutorial
/administrator is the path to the management background.
/cache is the cache directory.
/components is the component directory.
/includes is an important directory, which contains various scripts required for Joomla to run. , functions, etc.
/language is the website language directory.
/plugins is the extension (trigger) directory. The
/modules directory is where module programs are stored. Joomla has defined more than ten module locations, such as header, footer, left, right, debug, user1, advert2, etc.
/templates Template directory, each subdirectory inside corresponds to a template
/libraries Class package directory, all important class files
/logs Log directory, stores generated log script files
/images pictures Directory
/media directory is where various media files are stored.
/xmlrpc xml remote method call, using xml as the medium for calling remote methods
/tmp temporary directory
All components of Joomla! follow a specific naming scheme. Each system component has a unique name, and the name cannot include spaces.
The code is divided into two folders. The folder starts with com_, followed by the name of the component. eg: The component is named books. Therefore, you have to create two com_books folders with the same name
When the component is loaded in the foreground, Joomla! will look for the file componentname.php
Under the front components, directory com_books, file books.php.
Put it in the background administrator/components, directory com_books, file admin.books.php.
Database operations: Connect to the database - execute SQL statements - query data
1) Database operation to connect to the database
$db=& JFactory::getDBO();
2) Execute SQL statement
$sql="select * from #_tags";
$db ->execute($sql);
3) Query data
$sql="select * from #_tags";
$db->setQuery($sql);
$rows= $db->loadObjectList();
foreach($rows as $row){
echo $row->tag;
}
Session operation: call Session
1) Get the value of Session
$session=&JFactory::getSession();
$name="session_name";
$sValue=$session->get($name);
2) Set the value of Session
$session=JApplication::_createSession();
$name="session_name";
$value="alex";
$session->set ($name,$value);
Joomla! Common database tables
Article Categories
jos_categories
jos_sections
Joomla! components, modules, plug-ins
jos_components
jos_modules
jos_plugins
Article
jos_content
Menu
jos_menu
Users and logins
jos_groups
jos_session
jos_users