当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::link方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:intersvyaz,项目名称:yii-bootstrap,代码行数:10,代码来源:Breadcrumbs.php

示例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();
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:27,代码来源:Kalender.php

示例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;
}
开发者ID:lkmmmj,项目名称:iphp,代码行数:29,代码来源:functions.php

示例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));
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:28,代码来源:DatabaseController.php

示例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');
 }
开发者ID:aabcehmt,项目名称:fe,代码行数:10,代码来源:LocalidadController.php

示例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')));
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:Comments.php

示例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);
}
开发者ID:dvidos,项目名称:php-framework,代码行数:8,代码来源:listRecords.php

示例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;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:TagsBehavior.php

示例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);
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:ContactsRouter.php

示例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);
 }
开发者ID:tuanlq11,项目名称:cms,代码行数:15,代码来源:ObjectAction.php

示例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']);
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:11,代码来源:AdminModuleMenu.php

示例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);
         }
     }
 }
开发者ID:raalveco,项目名称:ASPOS-PROJECT,代码行数:12,代码来源:html.php

示例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');
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:17,代码来源:JsTree.php

示例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');
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:17,代码来源:JsTree.php

示例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));
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:49,代码来源:PagevisitController.php


注:本文中的Html::link方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。