本文整理汇总了PHP中view::setMetaTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP view::setMetaTitle方法的具体用法?PHP view::setMetaTitle怎么用?PHP view::setMetaTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::setMetaTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
public function set($plugin, $keyword, $replace = array(), $pageTitle = true)
{
if (!($data = $this->cache->item('core_meta_tags_' . $plugin . '_' . session::item('language')))) {
$data = array();
$result = $this->db->query("SELECT * FROM `:prefix:core_meta_tags` WHERE `plugin`=?", array($plugin))->result();
foreach ($result as $tags) {
$data[$tags['keyword']]['title'] = $tags['meta_title_' . session::item('language')];
$data[$tags['keyword']]['description'] = $tags['meta_description_' . session::item('language')];
$data[$tags['keyword']]['keywords'] = $tags['meta_keywords_' . session::item('language')];
}
$this->cache->set('core_meta_tags_' . $plugin . '_' . session::item('language'), $data, 60 * 60 * 24 * 30);
}
foreach ($replace as $section => $array) {
foreach ($array as $k => $v) {
$k = '[' . $section . '.' . $k . ']';
if (is_array($v)) {
$v = count($v) == 1 ? current($v) : implode(',', $v);
}
$data[$keyword]['title'] = utf8::str_replace($k, $v, $data[$keyword]['title']);
$data[$keyword]['description'] = utf8::str_replace($k, $v, $data[$keyword]['description']);
$data[$keyword]['keywords'] = utf8::str_replace($k, $v, $data[$keyword]['keywords']);
}
}
if (isset($data[$keyword])) {
if ($pageTitle) {
view::setTitle($data[$keyword]['title']);
} else {
view::setMetaTitle($data[$keyword]['title']);
}
view::setMetaDescription($data[$keyword]['description']);
view::setMetaKeywords($data[$keyword]['keywords']);
}
}
示例2: manage
public function manage()
{
// Is user loggedin ?
if (!users_helper::isLoggedin()) {
router::redirect('users/login');
}
// Assign user from session to variable
$user = session::section('session');
$user['config'] = session::section('config');
// Get user counters
$counters = hook::filter('users/profile/view/counters', array(), $user);
// Merge user and counters
if ($counters) {
$user = array_merge($user, $counters);
}
// Get fields
$fields = $this->fields_model->getFields('users', session::item('type_id'), 'view', 'in_view');
// Delete empty sections
$this->fields_model->deleteEmptySections($fields, $user);
// Assign vars
view::assign(array('user' => $user, 'fields' => $fields));
// Set title
view::setMetaTitle(__('my_profile', 'system_navigation'));
// Set trail
view::setTrail($user['slug'], __('my_profile', 'system_navigation'));
if (config::item('user_last_visit', 'users')) {
if (!$user['invisible']) {
if ($user['online']) {
view::setTrail(false, '<span class="users online">' . __('status_online', 'users') . '</span>', array('side' => true));
} else {
view::setTrail(false, '<span class="users date">' . __('status_visit_date', 'users', array('%span' => utf8::strtolower(date_helper::humanSpan($user['visit_date'])))) . '</span>', array('side' => true));
}
}
}
// Load view
view::load('users/profile/view');
}