本文整理汇总了PHP中Layout::addLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::addLink方法的具体用法?PHP Layout::addLink怎么用?PHP Layout::addLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::addLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showIcon
public static function showIcon($key)
{
PHPWS_Core::initModClass('rss', 'Channel.php');
$channel = new RSS_Channel();
$db = new PHPWS_DB('rss_channel');
$db->addWhere('module', $key->module);
$db->loadObject($channel);
if (empty($channel->id) || $channel->_error) {
return FALSE;
}
Layout::addLink(sprintf('<link rel="alternate" type="application/rss+xml" title="%s" href="%s" />', $channel->title, $channel->getAddress(FALSE)));
}
示例2: post
/**
* Handle the submit from the search form.
*
* @param \Request $request
* @return \Response
*/
public function post(\Request $request)
{
$script = PHPWS_SOURCE_HTTP . 'mod/systemsinventory/javascript/sys_pager.js';
$source_http = PHPWS_SOURCE_HTTP;
\Layout::addJSHeader("<script type='text/javascript'>var source_http = '{$source_http}';</script>");
\Layout::addLink("<script type='text/javascript' src='{$script}'></script>");
$factory = new Factory();
$search_vars = $request->getVars();
$_SESSION['system_search_vars'] = $search_vars['vars'];
\Pager::prepare();
$template = new \Template();
$template->setModuleTemplate('systemsinventory', 'search_results.html');
$view = new \View\HtmlView($template->get());
$response = new \Response($view);
return $response;
}
示例3: editDepartmentsView
public static function editDepartmentsView($data, $request)
{
$vars = array();
$departments = SystemDevice::getSystemDepartments();
$dep_options = '';
$dep_options .= '<option value="1">NONE</option>';
foreach ($departments as $val) {
if ($val['id'] != 1) {
$dep_options .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
}
}
$vars['departments'] = $dep_options;
$script = PHPWS_SOURCE_HTTP . 'mod/systemsinventory/javascript/edit_dept.js';
\Layout::addLink("<script type='text/javascript' src='{$script}'></script>");
$vars['add'] = '<a href="#" class="btn btn-md btn-success" data-toggle="modal" data-target="#edit-department-modal"><i class="fa fa-plus"> </i>Add Department</a>';
\Pager::prepare();
$template = new \Template();
$template = new \Template($vars);
$template->setModuleTemplate('systemsinventory', 'Edit_Departments.html');
return $template->get();
}