我比以前的功能和类更好一点。 PHP一般。我无法在任何地方找到任何关于如何做到这一点的事情,但基本上我之后的目标是html。里面是主题,资产和你提供的所有其他好东西。主题是当您访问网站时加载的主要php文件的位置,但有时您必须包含主题本身的文件。 为此,我的想法是设置主题的路径
class CSite {
public $db;
public $sitesettings = array(
'host' => "192.168.176.128",
'path' => "themepath",
'Sitename' => 'My Theme',
'Copyright' => YourCopyright,
);
public function __construct() {
$this->sitename = $this->sitesettings['Sitename'];
$this->host = $this->sitesettings['host'];
$this->path = $this->sitesettings['path'];
$this->protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$this->rootpath = root_path.'/';
$this->themepath = 'themes/'.$this->sitesettings['path'].'/';
$this->copyright = $this->sitesettings['Copyright'].'<br />Proudly Powered By Doxramos CMS';
$this->db = new db();
}
public function ThemeInclude() {
include_once($theme->path);
}
但我不确定如何完成甚至知道从哪里开始的部分是说他们在主题中有一个functions.php文件。我希望主题文件夹中的语法与
一致$Site = new CSite();
$Site->ThemeInclude('functions.php');
从那里开始运行include_once($theme->path.'/functions.php');
有没有人可以使用这个起点?