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


PHP Utils\Html类代码示例

本文整理汇总了PHP中Nette\Utils\Html的典型用法代码示例。如果您正苦于以下问题:PHP Html类的具体用法?PHP Html怎么用?PHP Html使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Html类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($name, $label)
 {
     $this->monitor('Drahak\\Tables\\Table');
     parent::__construct(NULL, $name);
     $this->cellPrototype = Html::el('td');
     $this->labelPrototype = Html::el('th');
     $this->labelPrototype->add(Html::el('a', $label));
     $this->column = $name;
 }
开发者ID:drahak,项目名称:tables,代码行数:9,代码来源:Column.php

示例2: tryAddIcon

 /**
  * Should the element has an icon?
  * @param  Html            $el
  * @param  string|null     $icon
  * @param  string          $name
  * @return void
  */
 public function tryAddIcon(Html $el, $icon, $name)
 {
     if ($icon) {
         $el->addHtml(Html::el('span')->class(DataGrid::$icon_prefix . $icon));
         if (strlen($name)) {
             $el->addHtml(' ');
         }
     }
 }
开发者ID:ublaboo,项目名称:datagrid,代码行数:16,代码来源:TButtonTryAddIcon.php

示例3: renderAllErrors

    public function renderAllErrors(UI\Form $form)
    {
        $html = '';
        foreach ($form->getErrors() as $error) {
            $html .= '<div class="alert alert-danger">
							<a class="close" data-dismiss="alert">×</a>' . $error . '
						</div>';
        }
        $errors = new Html();
        $errors->setHtml($html);
        return $errors;
    }
开发者ID:jirinapravnik,项目名称:common,代码行数:12,代码来源:Bs3FormRenderer.php

示例4: input

 public static function input(Html $input, BaseControl $control, $isPart)
 {
     $name = $input->getName();
     if ($name === 'select' || $name === 'textarea' || $name === 'input' && !in_array($input->type, array('radio', 'checkbox', 'file', 'hidden', 'range', 'image', 'submit', 'reset'))) {
         $input->addClass('form-control');
     } elseif ($name === 'input' && ($input->type === 'submit' || $input->type === 'reset')) {
         $input->addClass('btn');
         //			$input->setName('button');
         //			if($input->value !== NULL){
         //				$input->add($input->value);
         //			}
     }
     return $input;
 }
开发者ID:jirinapravnik,项目名称:common,代码行数:14,代码来源:Bootstrap3InputMacros.php

示例5: menuTitle

 /**
  * Get menu title
  *
  * @return string
  */
 public function menuTitle()
 {
     if ($this->count > 0) {
         return $this->tableSingleName . ' ' . Html::el('span class=update-plugins')->add(Html::el('span class="update-count"')->setText($this->count));
     }
     return $this->tableSingleName;
 }
开发者ID:jekv,项目名称:devia,代码行数:12,代码来源:Repository.php

示例6: getControl

 public function getControl()
 {
     $container = Html::el();
     $container->add($this->wrappedControl->getControl());
     $container->add($this->applyButton->getControl($this->caption));
     return $container;
 }
开发者ID:mike227,项目名称:n-forms,代码行数:7,代码来源:ApplyButtonWrapper.php

示例7: create

  /**
 * Formular pre editaciu udajov
 * @param boolean $admin
 * @param array $druh
 * @return Nette\Application\UI\Form
 */
  public function create($admin, $druh, $ur_reg)
  {
      $this->ur_reg = $ur_reg;
      $form = new Form();
      $form->addProtection();
      $form->addGroup();
      $form->addHidden('id');
      $form->addHidden('id_udaje_typ');
      if ($admin) {
          $form->addText('nazov', 'Názov prvku:', 20, 20)->addRule(Form::MIN_LENGTH, 'Názov musí mať spoň %d znaky!', 2)->setAttribute('class', 'heading')->setRequired('Názov musí byť zadaný!');
          $form->addText('comment', 'Komentár k hodnote :', 90, 255)->addRule(Form::MIN_LENGTH, 'Komentár musí mať spoň %d znaky!', 2)->setRequired('Komentár musí byť zadaný!');
      } else {
          $form->addHidden('nazov');
          $form->addHidden('comment');
      }
      $form->addText('text', 'Hodnota prvku:', 90, 255)->setRequired('Hodnota prvku musí byť zadaná!');
      if ($admin) {
          $form->addCheckbox('spravca', ' Povolená zmena pre správcu')->setDefaultValue(1);
          $form->addCheckbox("druh_null", " Hodnota druhu je NULL")->setDefaultValue(1)->addCondition(Form::EQUAL, TRUE)->toggle("druh", FALSE);
          $form->addGroup()->setOption('container', Html::el('fieldset')->id("druh"));
          $form->addSelect('id_druh', 'Druhová skupina pre nastavenia:', $druh)->setDefaultValue(1);
          $form->setCurrentGroup(NULL);
开发者ID:petak23,项目名称:echo-msz,代码行数:28,代码来源:EditUdajeFormFactory.php

示例8: getHeaderContent

 public function getHeaderContent()
 {
     if (!isset($this->option[self::ORDERING])) {
         $this->option[self::ORDERING] = TRUE;
     }
     if (isset($this->option[self::ORDERING]) && $this->option[self::ORDERING]) {
         $ordering = $this->grid['ordering']->getOrdering($this->option[self::ID]);
         $link = Html::el('a', array('href' => $this->grid['ordering']->link('ordering!', $this->option[self::ID]), 'class' => 'mesour-ajax ordering' . (!is_null($ordering) ? ' ' . strtolower($ordering) : '')));
         $link->setText($this->getTranslator() ? $this->getTranslator()->translate($this->option[self::HEADER]) : $this->option[self::HEADER]);
         $link->addHtml(Html::el('span', array('class' => 'glyphicon no-sort'))->setHtml('&nbsp;'));
         if ($this instanceof Number || $this instanceof Date) {
             $link->addHtml(Html::el('span', array('class' => 'order-asc glyphicon glyphicon-sort-by-order')));
             $link->addHtml(Html::el('span', array('class' => 'order-desc glyphicon glyphicon-sort-by-order-alt')));
         } else {
             if ($this instanceof Status) {
                 $link->addHtml(Html::el('span', array('class' => 'order-asc glyphicon glyphicon-sort-by-attributes')));
                 $link->addHtml(Html::el('span', array('class' => 'order-desc glyphicon glyphicon-sort-by-attributes-alt')));
             } else {
                 $link->addHtml(Html::el('span', array('class' => 'order-asc glyphicon glyphicon-sort-by-alphabet')));
                 $link->addHtml(Html::el('span', array('class' => 'order-desc glyphicon glyphicon-sort-by-alphabet-alt')));
             }
         }
         return $link;
     } else {
         return $this->getTranslator() ? $this->getTranslator()->translate($this->option[self::HEADER]) : $this->option[self::HEADER];
     }
 }
开发者ID:mesour,项目名称:datagrid,代码行数:27,代码来源:BaseOrdering.php

示例9: createComponentCarouselGrid

 public function createComponentCarouselGrid($name)
 {
     $grid = new \Ublaboo\DataGrid\DataGrid($this, $name);
     $test = $this->database->table("carousel")->order("sorted");
     $grid->setDataSource($test);
     $grid->setSortable(true);
     $grid->addGroupAction('Smazat')->onSelect[] = [$this, 'handleDelete'];
     $grid->addColumnText('title', 'dictionary.main.Title')->setRenderer(function ($item) {
         if ($item->title == '') {
             $title = \Nette\Utils\Html::el('a')->href('/admin/appearance/carousel-detail/' . $item->id)->setText('- nemá název - ');
         } else {
             $title = \Nette\Utils\Html::el('a')->href('/admin/appearance/carousel-detail/' . $item->id)->setText($item->title);
         }
         return $title;
     });
     $grid->addColumnText('test', 'dictionary.main.Image')->setRenderer(function ($item) {
         if ($item->image == '') {
             $fileImage = '';
         } else {
             $fileImage = \Nette\Utils\Html::el('img', array('style' => 'max-height: 130px;'))->src('/images/carousel/' . $item->image);
         }
         return $fileImage;
     });
     $grid->setTranslator($this->presenter->translator);
 }
开发者ID:caloriscz,项目名称:caloriscms,代码行数:25,代码来源:CarouselGridControl.php

示例10: getElementPrototype

 /**
  * @return Html
  */
 public function getElementPrototype()
 {
     if ($this->elementPrototype === NULL) {
         $this->elementPrototype = Html::el('div');
     }
     return $this->elementPrototype;
 }
开发者ID:brosland,项目名称:modals,代码行数:10,代码来源:Modal.php

示例11: __construct

 public function __construct(IContainer $parent = NULL, $name = NULL)
 {
     parent::__construct($name, $parent);
     $this->elementPrototype = Html::el('table');
     // Setup table
     $this->setup();
 }
开发者ID:drahak,项目名称:tables,代码行数:7,代码来源:Table.php

示例12: createTemplate

 protected function createTemplate($class = NULL)
 {
     $servise = $this;
     $template = parent::createTemplate($class);
     $template->addFilter('obr_v_txt', function ($text) use($servise) {
         $rozloz = explode("#", $text);
         $serv = $servise->presenter;
         $vysledok = '';
         $cesta = 'http://' . $serv->nazov_stranky . "/";
         foreach ($rozloz as $k => $cast) {
             if (substr($cast, 0, 2) == "I-") {
                 $obr = $serv->dokumenty->find((int) substr($cast, 2));
                 if ($obr !== FALSE) {
                     $cast = \Nette\Utils\Html::el('a class="fotky" rel="fotky"')->href($cesta . $obr->subor)->title($obr->nazov)->setHtml(\Nette\Utils\Html::el('img')->src($cesta . $obr->thumb)->alt($obr->nazov));
                 }
             }
             $vysledok .= $cast;
         }
         return $vysledok;
     });
     $template->addFilter('koncova_znacka', function ($text) use($servise) {
         $rozloz = explode("{end}", $text);
         $vysledok = $text;
         if (count($rozloz) > 1) {
             //Ak som nasiel znacku
             $vysledok = $rozloz[0] . \Nette\Utils\Html::el('a class="cely_clanok"')->href($servise->link("this"))->title($servise->texty["title"])->setHtml('&gt;&gt;&gt; ' . $servise->texty["viac"]) . '<div class="ostatok">' . $rozloz[1] . '</div>';
         }
         return $vysledok;
     });
     return $template;
 }
开发者ID:petak23,项目名称:echo-msz,代码行数:31,代码来源:Aktualne.php

示例13: create

 public function create()
 {
     $tree = Html::el('div', $this->attributes);
     $tree->add($this->header->create());
     $tree->add($this->body->create());
     return $tree;
 }
开发者ID:Aearsis,项目名称:DataGrid,代码行数:7,代码来源:Renderer.php

示例14: getWrapperPrototype

 /**
  * @return Html
  */
 protected function getWrapperPrototype()
 {
     if ($this->wrapper == NULL) {
         $this->wrapper = Html::el("div");
     }
     return $this->wrapper;
 }
开发者ID:f3l1x,项目名称:nette-plugins,代码行数:10,代码来源:MarkupControl.php

示例15: __construct

 /**
  * @param string $label
  * @param CaptchaProvider $provider
  */
 public function __construct($label, CaptchaProvider $provider)
 {
     parent::__construct($label);
     $this->provider = $provider;
     $this->control = Html::el('img');
     $this->control->addClass('captcha-image seznam-captcha-image');
 }
开发者ID:minetro,项目名称:seznamcaptcha,代码行数:11,代码来源:CaptchaImage.php


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