本文整理汇总了PHP中Html::link方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::link方法的具体用法?PHP Html::link怎么用?PHP Html::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @inheritdoc
*/
public function init()
{
$this->separator = '<span class="divider">' . $this->separator . '</span>';
if ($this->homeLink === null) {
$this->homeLink = Html::link(\Yii::t('zii', 'Home'), \Yii::app()->homeUrl);
}
}
示例2: class_init
function class_init(&$system)
{
$this->system =& $system;
$this->connection = $system->connection;
$this->pfad();
if ($this->check_right('KalenderIntern') && !stristr(SELF, 'admin') && stristr(SELF, 'Kalender')) {
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/Admin/KalenderAdmin");
} else {
$GLOBALS['TemplateVars']['NaviLogin'] = true;
}
if (!class_exists('FormScaffold')) {
include_once 'FormScaffold.php';
}
if (!class_exists('KalFormScaff')) {
include_once 'Kalender/KalFormScaff.php';
}
$this->scaff = new KalFormScaff($this->db_table, $this->connection);
$this->scaff->monate = $this->monate;
$this->scaff->cols_array['STATUS']['options'] = array('CONFIRMED' => 'fest', 'TENTATIVE' => 'vorläufig', 'CANCELLED' => 'storniert');
$this->scaff->cols_array['CLASS']['options'] = array('PUBLIC' => 'öffentlich', 'PRIVATE' => 'nicht öffentlich');
$this->scaff->cols_array['DESCRIPTION']['html'] = true;
$this->scaff->cols_array['DTSTART']['type'] = 'timestamp';
$this->scaff->cols_array['DTEND']['type'] = 'timestamp';
$this->categories = $this->connection->db_assoc("SELECT * FROM `RheinaufCMS>Kalender>Kategorien`");
$GLOBALS['other_css'] = Html::link(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => '/Module/Kalender/Kalender.css'));
$this->event_listen();
}
示例3: _url
function _url($url = '', $params = array())
{
static $special_actions = array('view');
if (is_object($params)) {
$p = array();
if (isset($params->id)) {
$p['id'] = $params->id;
}
$params = $p;
}
if (strpos($url, 'http://') === false && strpos($url, 'https://') === false) {
$ps = explode('/', $url);
$act = $ps[count($ps) - 1];
if (isset($params['id']) && preg_match('/^\\d+$/', $params['id']) && in_array($act, $special_actions)) {
$ps[count($ps) - 1] = $params['id'];
if ($act != 'view') {
$ps[count($ps)] = $act;
}
unset($params['id']);
} else {
if ($act == 'list') {
unset($ps[count($ps) - 1]);
}
}
$url = join('/', $ps);
}
$url = Html::link($url, $params);
return $url;
}
示例4: actionIndex
public function actionIndex()
{
$model = new SettingsDatabaseForm();
$this->pageName = Yii::t('app', 'DATABASE');
$this->breadcrumbs = array(Yii::t('app', 'SYSTEM') => array('admin/index'), $this->pageName);
$post = $_POST['SettingsDatabaseForm'];
$model->attributes = $post;
if (isset($post) && $model->backup) {
Yii::app()->database->export();
$this->setFlashMessage(Yii::t('app', 'BACKUP_DB_SUCCESS'));
$this->refresh();
}
$backupPath = Yii::getPathOfAlias(Yii::app()->database->backupPath);
if (file_exists($backupPath)) {
$fdir = opendir($backupPath);
$data = array();
while ($file = readdir($fdir)) {
if ($file != '.' and $file != '..' and $file != '.htaccess' and $file != 'index.html') {
$data[] = array('filename' => $file, 'url' => Html::link(Yii::t('app', 'DELETE'), '/admin/core/database/delete?file=' . $file, array('class' => 'btn btn-danger btn-xs')));
}
}
closedir($fdir);
} else {
throw new CHttpException(404, Yii::t('app', 'DIR_NOT_FOUND', array('{dir}' => Yii::app()->database->backupPath)));
}
$data_db = new CArrayDataProvider($data, array('sort' => array('attributes' => array('filename'), 'defaultOrder' => array('filename' => false))));
$this->render('index', array('model' => $model, 'data_db' => $data_db));
}
示例5: __construct
/**
* constructor de la clase
*/
public function __construct()
{
$href = route('cities.localidades.index');
$this->ruta = $this->listOneBreadcrumb('localidades', $href);
$this->donde_estoy[0] = \Html::link('home', 'home');
$this->donde_estoy[1] = \Html::linkRoute('cities.localidades.index', 'localidades');
}
示例6: getDeleteLink
public function getDeleteLink()
{
$userId = Yii::app()->user->id;
$stime = strtotime($this->date_create) + Yii::app()->settings->get('comments', 'control_timeout');
if ($userId == $this->user_id || Yii::app()->user->isSuperuser) {
return Html::link('<i class="fa fa-remove"></i>', 'javascript:void(0)', array("onClick" => "\$('#comment_" . $this->id . "').comment('remove',{time:" . $stime . ", pk:" . $this->id . ", csrf:'" . Yii::app()->request->csrfToken . "'}); return false;", 'class' => 'btn btn-primary btn-sm', 'title' => Yii::t('app', 'DELETE')));
}
}
示例7: createActionLink
function createActionLink($caption, $tableInfo, $baseRoute, $action, $record)
{
$url = array($baseRoute, 'table' => $tableInfo['name'], 'action' => $action);
foreach ($tableInfo['pkFields'] as $pkField) {
$url[$pkField] = $record[$pkField];
}
return Html::link($caption, $url);
}
示例8: getTagLinks
public function getTagLinks()
{
$links = array();
foreach (Tag::string2array($this->getOwner()->tags) as $tag) {
$links[] = Html::link(Html::encode($tag), array($this->router, 'tag' => $tag));
}
return $links;
}
示例9: getForm
public function getForm()
{
Yii::import('ext.colorpicker.ColorPicker');
Yii::import('ext.bootstrap.fileinput.Fileinput');
Yii::import('ext.bootstrap.selectinput.SelectInput');
Yii::app()->controller->widget('ext.tinymce.TinymceWidget');
return new TabForm(array('attributes' => array('id' => __CLASS__, 'class' => 'form-horizontal'), 'showErrorSummary' => true, 'elements' => array('general' => array('type' => 'form', 'title' => self::t('TAB_GENERAL'), 'elements' => array('name' => array('type' => 'text'), 'map_id' => array('type' => 'SelectInput', 'data' => Html::listData(ContactsMaps::model()->findAll(), 'id', 'name')), 'preset' => array('type' => 'text', 'hint' => self::t('HINT_PRESET', array('{link}' => Html::link('https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/option.presetStorage-docpage/', 'https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/option.presetStorage-docpage/', array('target' => '_blank'))))), 'mapStateAutoApply' => array('type' => 'checkbox'), 'color' => array('type' => 'ColorPicker'), 'opacity' => array('type' => 'SelectInput', 'data' => self::getOpacityList()))), 'start_point' => array('type' => 'form', 'title' => self::t('TAB_START'), 'elements' => array('start_coords' => array('type' => 'text'), 'start_icon_content' => array('type' => 'text'), 'start_balloon_content_body' => array('type' => 'textarea', 'class' => 'editor'), 'start_icon_content' => array('type' => 'text'))), 'end_point' => array('type' => 'form', 'title' => self::t('TAB_END'), 'elements' => array('end_coords' => array('type' => 'text'), 'end_icon_content' => array('type' => 'text'), 'end_balloon_content_body' => array('type' => 'textarea', 'class' => 'editor'), 'end_icon_content' => array('type' => 'text')))), 'buttons' => array('submit' => array('type' => 'submit', 'class' => 'btn btn-success', 'label' => $this->isNewRecord ? Yii::t('app', 'CREATE', 0) : Yii::t('app', 'SAVE')))), $this);
}
示例10: editObjectAction
/**
* Generate HTML for object action Edit
*
* @param $object Model
*
* @return string
*/
protected function editObjectAction($object, $config)
{
if (!$this->isActionTrusted('edit')) {
return '';
}
$actionURL = \Html::link($this->getGeneratedUrl('edit', [$object->id]), trans(array_get($config, 'label')));
return sprintf('<li>%s</li>', $actionURL);
}
示例11: renderMenuItem
protected function renderMenuItem($item)
{
if (isset($item['url'])) {
$icon = isset($item['icon']) ? '<i class="fa ' . $item['icon'] . '"></i>' : '';
$count = isset($item['count']) ? '<span class="' . (isset($item['countClass']) ? $item['countClass'] : 'dataNumGreen') . '">' . $item['count'] . '</span>' : '';
$label = $this->linkLabelWrapper === null ? $item['label'] : Html::tag($this->linkLabelWrapper, $this->linkLabelWrapperHtmlOptions, $item['label']);
return Html::link($icon . $label . $count, $item['url'], isset($item['linkOptions']) ? $item['linkOptions'] : array());
} else {
return Html::tag('span', isset($item['linkOptions']) ? $item['linkOptions'] : array(), $item['label']);
}
}
示例12: linkear
public static function linkear($url, $texto, $contenedor = "")
{
if ($contenedor == "") {
return Html::link($url, $texto);
} else {
if ($contenedor == "blank" || $contenedor == "_blank") {
return Html::link($url, $texto, "target: _blank");
} else {
return Html::linkAjax($url, $texto, $contenedor);
}
}
}
示例13: createHtmlTree
/**
* Create ul html tree from data array
* @param string $data
*/
private function createHtmlTree($data)
{
foreach ($data as $node) {
echo Html::openTag('li', array('id' => $this->id . 'Node_' . $node['id'], 'data-status' => $node['switch'], 'class' => $node['switch'] ? '' : 'hiddenClass'));
echo Html::link(Html::encode($node->name));
if ($node['hasChildren'] === true) {
echo Html::openTag('ul');
$this->createHtmlTree($node['children']);
echo Html::closeTag('ul');
}
echo Html::closeTag('li');
}
}
示例14: createHtmlTree
/**
* Create ul html tree from data array
* @param string $data
*/
private function createHtmlTree($data)
{
foreach ($data as $node) {
echo Html::openTag('li', array());
echo Html::link(Html::encode($node->name));
if ($node['hasChildren'] === true) {
echo Html::openTag('ul');
$this->createHtmlTree($node['children']);
echo Html::closeTag('ul');
}
echo Html::closeTag('li');
}
}
示例15: actionIndex
public function actionIndex()
{
$this->pageName = Yii::t('StatsModule.default', 'BROWSERS');
$this->breadcrumbs = array(Yii::t('StatsModule.default', 'MODULE_NAME') => array('/admin/shop'), $this->pageName);
$stats = Yii::app()->stats->initRun();
$zp = $stats['zp'];
if ($this->sort == "hi") {
$z = "SELECT req, COUNT(req) cnt FROM cms_surf WHERE";
$z .= $zp . " AND dt >= '{$this->sdate}' AND dt <= '{$this->fdate}' GROUP BY req ORDER BY 2 DESC";
$res = Yii::app()->db->createCommand($z)->queryAll();
$z2 = "SELECT SUM(t.cnt) as cnt FROM (" . $z . ") t";
$r = Yii::app()->db->createCommand($z2)->queryRow();
} else {
$z = "CREATE TEMPORARY TABLE IF NOT EXISTS tmp_surf SELECT ip, req FROM cms_surf WHERE";
$z .= $zp . " AND dt >= '{$this->sdate}' AND dt <= '{$this->fdate}' GROUP BY ip, req";
$z2 = "SELECT req, COUNT(req) cnt FROM tmp_surf GROUP BY req ORDER BY 2 DESC";
$transaction = Yii::app()->db->beginTransaction();
try {
Yii::app()->db->createCommand($z)->execute();
$transaction->commit();
} catch (Exception $e) {
$transaction->rollBack();
}
$res = Yii::app()->db->createCommand($z2)->queryAll();
$z3 = "SELECT SUM(t.cnt) as cnt FROM (" . $z2 . ") t";
$transaction2 = Yii::app()->db->beginTransaction();
try {
Yii::app()->db->createCommand($z)->execute();
$transaction2->commit();
} catch (Exception $e) {
$transaction2->rollBack();
}
$r = Yii::app()->db->createCommand($z3)->queryRow();
}
$cnt = $r['cnt'];
$k = 0;
foreach ($res as $row) {
if ($k == 0) {
$max = $row['cnt'];
}
if ($row['req'] == "") {
$row['req'] = "<font color=grey>неизвестно</font>";
}
$k++;
$result[] = array('num' => $k, 'req' => Html::link($row['req'], $row['req'], array('traget' => '_blank')), 'h' => $row['cnt'], 'graphic' => "<img align=left src=/stats/px" . ($this->sort == "hi" ? "h" : "u") . ".gif width=" . ceil($row['cnt'] * 100 / $max) . " height=11 border=0>", 'pracent' => number_format($row['cnt'] * 100 / $cnt, 1, ',', ''), 'detail' => Html::link('>>>', "?pz=1&tz=1&item=req&s_date=" . StatsHelper::dtconv($this->sdate) . "&f_date=" . StatsHelper::dtconv($this->fdate) . "&qs=" . urlencode($row['req']) . "&sort=" . (empty($this->sort) ? "ho" : $this->sort), array('traget' => '_blank')));
}
$dataProvider = new CArrayDataProvider($result, array('sort' => array('attributes' => array('ip' => array('asc' => 'ip DESC', 'desc' => 'ip ASC'), 'refer' => array('asc' => 'refer DESC', 'desc' => 'refer ASC'))), 'pagination' => array('pageSize' => 10)));
$this->render('index', array('dataProvider' => $dataProvider));
}