本文整理汇总了PHP中AdministrationPage::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP AdministrationPage::generate方法的具体用法?PHP AdministrationPage::generate怎么用?PHP AdministrationPage::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdministrationPage
的用法示例。
在下文中一共展示了AdministrationPage::generate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
public function generate()
{
if ($this->_useTemplate !== false) {
$template = $this->viewDir . '/' . (empty($this->_useTemplate) ? $this->_getTemplate($this->_type, $this->_function) : $this->_useTemplate . '.xsl');
if (file_exists($template)) {
$current_path = explode(dirname($_SERVER['SCRIPT_NAME']), $_SERVER['REQUEST_URI'], 2);
$current_path = '/' . ltrim(end($current_path), '/');
$params = array('today' => DateTimeObj::get('Y-m-d'), 'current-time' => DateTimeObj::get('H:i'), 'this-year' => DateTimeObj::get('Y'), 'this-month' => DateTimeObj::get('m'), 'this-day' => DateTimeObj::get('d'), 'timezone' => DateTimeObj::get('P'), 'website-name' => Symphony::Configuration()->get('sitename', 'general'), 'root' => URL, 'symphony-url' => SYMPHONY_URL, 'workspace' => URL . '/workspace', 'current-page' => strtolower($this->_type) . ucfirst($this->_function), 'current-path' => $current_path, 'current-url' => URL . $current_path, 'upload-limit' => min($upload_size_php, $upload_size_sym), 'symphony-version' => Symphony::Configuration()->get('version', 'symphony'));
$html = $this->_XSLTProc->process($this->_XML->generate(), file_get_contents($template), $params);
if ($this->_XSLTProc->isErrors()) {
$errstr = NULL;
while (list($key, $val) = $this->_XSLTProc->getError()) {
$errstr .= 'Line: ' . $val['line'] . ' - ' . $val['message'] . self::CRLF;
}
throw new SymphonyErrorPage(trim($errstr), NULL, 'xslt-error', array('proc' => clone $this->_XSLTProc));
}
} else {
Administration::instance()->errorPageNotFound();
}
$this->Form = NULL;
$this->Contents->setValue($html);
}
return parent::generate();
}