Mega PHP Template Engine

Using databases

If you are using databases in the project

Use the 5 Files PHP Inside a Folder "megatpl"

You can customize the settings in the file "mega.class.php"
As the picture

Name Leave empty templates folder when using databases will be automatically extracted from the config table

['use_database'] = true;
Enable the use of databases

['class_database']   = true;
Enable internal database functions for the template

['use_var_config']   = true;
Enable the internal function $config of template

Use the table within the database
-- Table structure for table `config`

  `config_name` varchar(255) collate utf8_bin NOT NULL default '',
  `config_value` text collate utf8_bin NOT NULL,
  PRIMARY KEY  (`config_name`)

-- Dumping data for table `config`

INSERT INTO `config` (`config_name`, `config_value`) VALUES
('sitename', ' Mega Template'),
('sitedesc', 'Mega PHP Template Engine'),
('sitethemes', 'default'),
('sitemail', ''),
('siteurl', 'siteurl'),
('sitekey', 'sitekey'),
('charset', 'UTF-8');

Internal variables used within the template
Code HTML: