Exemple #1
0
<?php

echo \Micro\Web\Html\Html::openTag('div', ['class' => 'menu']);
echo implode(' ', $this->menu);
echo \Micro\Web\Html\Html::closeTag('div');
Exemple #2
0
<?php

/** @var \App\Modules\Blog\Models\Blog $model */
use Micro\Web\Html\Html;
echo Html::href('Назад', '/blog/post');
echo Html::heading(1, $model->name);
echo Html::openTag('p'), $model->content, Html::closeTag('p');
Exemple #3
0
<?php

use Micro\Web\Html\Html;
/** @var \App\Components\View $this */
$this->title .= ' - Главная';
echo Html::heading(1, 'Simple app');
echo Html::openTag('p');
?>
This site is a simple<?php 
echo Html::closeTag('p');
 /**
  * Run drawing
  *
  * @access public
  *
  * @return void
  */
 public function run()
 {
     $result = Html::openTag('dl', $this->attributes);
     foreach ($this->columns as $key => $val) {
         $result .= Html::openTag('dt', $this->attributesElement);
         $result .= $val['title'];
         $result .= Html::closeTag('dt');
         $result .= Html::openTag('dd', $this->attributesValue);
         $buffer = '';
         /** @noinspection DegradedSwitchInspection */
         switch ($val['type']) {
             case 'raw':
                 $buffer .= eval('$data = $this->data; return ' . $val['value']);
                 break;
             default:
                 if (property_exists($this->data, $val['value'])) {
                     $buffer .= htmlspecialchars($this->data->{$val['value']});
                 } else {
                     $buffer .= htmlspecialchars($val['value']);
                 }
         }
         $result .= (strlen($buffer) ? $buffer : '&nbsp;') . Html::closeTag('dd');
     }
     echo $result, Html::closeTag('dl');
 }
 /**
  * Get elements
  *
  * @access protected
  *
  * @return string
  */
 protected function getElements()
 {
     if (!$this->rows) {
         return Html::openTag('div', $this->attributesEmpty) . $this->emptyText . Html::closeTag('div');
     }
     ob_start();
     echo Html::openTag('ul', $this->attributes);
     /** @noinspection PhpUnusedLocalVariableInspection */
     foreach ($this->rows as $element) {
         echo Html::openTag('li', $this->attributesElement);
         /** @noinspection PhpIncludeInspection */
         /** @noinspection UntrustedInclusionInspection */
         include $this->pathView;
         echo Html::closeTag('li');
     }
     echo Html::closeTag('ul');
     return ob_get_clean();
 }
Exemple #6
0
 /**
  * Render week field row
  *
  * @access public
  *
  * @param IFormModel $model model
  * @param string $property model property
  * @param array $options attribute array
  *
  * @return string
  */
 public function weekFieldRow(IFormModel $model, $property, array $options = [])
 {
     $element = $this->getField($model, $property);
     $options['id'] = $element['id'];
     return Html::openTag('div', $this->getBlock('block', $options)) . Html::label($model->getLabel($property), $element['id'], $this->getBlock('label', $options)) . $this->weekField($model, $property, $options) . Html::closeTag('div');
 }
Exemple #7
0
 /**
  * Insert styles and scripts into cache
  *
  * @access protected
  *
  * @param string $cache cache of generated page
  *
  * @return string
  */
 protected function insertStyleScripts($cache)
 {
     $heads = '';
     $ends = '';
     $result = '';
     foreach ($this->styleScripts as $element) {
         if ($element['isHead']) {
             $heads .= $element['body'];
         } else {
             $ends .= $element['body'];
         }
     }
     $positionHead = strpos($cache, Html::closeTag('head'));
     $positionBody = strpos($cache, Html::closeTag('body'), $positionHead);
     $result .= substr($cache, 0, $positionHead);
     $result .= $heads;
     $result .= substr($cache, $positionHead, $positionBody);
     $result .= $ends;
     $result .= substr($cache, $positionHead + $positionBody);
     return $result;
 }
 /**
  * Render rows
  *
  * @access protected
  *
  * @return null|string
  */
 protected function renderRows()
 {
     $result = null;
     if (0 === count($this->rows)) {
         return Html::openTag('tr') . Html::openTag('td', ['cols' => count($this->fields)]) . $this->emptyText . Html::closeTag('td') . Html::closeTag('tr');
     }
     foreach ($this->rows as $data) {
         $result .= Html::openTag('tr');
         foreach ($this->tableConfig as $key => $row) {
             $result .= Html::openTag('td', $row['attributes']);
             if (!empty($row['class']) && is_subclass_of($row['class'], 'Micro\\Widget\\GridColumn')) {
                 $primaryKey = $data->{!empty($row['key']) ? $row['key'] : 'id'};
                 $result .= (string) new $row['class']($row + ['str' => null === $data ?: $data, 'pKey' => $primaryKey]);
             } elseif (!empty($row['value'])) {
                 $result .= eval('return ' . $row['value'] . ';');
             } else {
                 $result .= property_exists($data, $key) ? $data->{$key} : null;
             }
             $result .= Html::closeTag('td');
         }
         $result .= Html::closeTag('tr');
     }
     return $result;
 }
Exemple #9
0
    <?php 
echo Html::title($this->container->company);
?>
    <?php 
echo Html::tag('base', ['href' => '/']);
echo Html::closeTag('head');
echo Html::openTag('body', ['class' => 'container-fluid', 'ngView' => '']);
?>


<div class="container-fluid">
    <div class="row-fluid">
        <div class="col-md-12 text-center"><h2><headerbar></headerbar></h2></div>
    </div>
    <div class="row-fluid">
        <div class="col-md-2">
            Sidebar
        </div>
        <div class="col-md-10">
            <?php 
echo $content;
?>
        </div>
    </div>
</div>


<?php 
echo Html::closeTag('body');
echo Html::closeTag('html');
 /**
  * Finish form render
  *
  * @access public
  * @return void
  */
 public function endRender()
 {
     if (!empty($this->config['legend'])) {
         echo Html::closeTag('fieldset');
     }
     $this->widget->run();
 }