本文整理汇总了PHP中tag::create方法的典型用法代码示例。如果您正苦于以下问题:PHP tag::create方法的具体用法?PHP tag::create怎么用?PHP tag::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tag
的用法示例。
在下文中一共展示了tag::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
protected function build()
{
$this->add(new HiddenBox($this->id));
$build_tag_from_datasource = false;
if ($this->get_par('database-save-parameters')) {
$this->att('class', 'osy-taglist-onextab', true);
$build_tag_from_datasource = true;
}
$ul = $this->add(tag::create('ul'));
if ($sql = $this->get_par('datasource-sql')) {
$sql = HelperOsy::replacevariable($sql);
$res = $this->db->exec_query($sql, null, 'NUM');
$datalist = $this->add(tag::create('datalist'));
$datalist->att('id', $this->id . '_data');
foreach ($res as $k => $rec) {
if ($rec[2] == 1) {
$ul->add('<li class="osy-taglist-entry" tid="' . $rec[0] . '"><span class="osy-taglist-entry-text">' . $rec[1] . '</span><a href="#" class="osy-taglist-entry-remove">remove</a></li>');
}
$datalist->add(tag::create('option'))->add($rec[1]);
}
}
if (!$build_tag_from_datasource && !empty($_REQUEST[$this->id])) {
$item_list = explode(',', $_REQUEST[$this->id]);
foreach ($item_list as $k => $v) {
$ul->add('<li class="osy-taglist-entry" pos="' . $k . '"><span class="osy-taglist-entry-text">' . $v . '</span><a href="#" class="osy-taglist-entry-remove">remove</a></li>');
}
}
$txt = $ul->add(tag::create('li'))->att('class', 'listbuilder-entry-text')->add(tag::create('input'))->att('name', $this->id . '_add')->att('type', 'text')->att('class', 'add osy-taglist-input');
if (isset($datalist)) {
$txt->att('list', $this->id . '_data');
}
$ul->add('<br style="clear: both">');
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @param
* @return \Illuminate\Http\Response
*/
public function store()
{
if (!Input::get('name') or !Input::get('done') or !Input::get('priority')) {
return $this->setStatusCode(IlluminateResponse::HTTP_UNPROCESSABLE_ENTITY)->respondWithError('Parameters failed validation for a tag.');
}
tag::create(Input::all());
return $this->respondCreated('tag successfully created.');
}
示例3: __construct
public function __construct($name)
{
parent::__construct('div');
$this->class = 'osy-textsearch';
$this->id = $name;
$this->add(new HiddenBox($name));
$this->textBox = $this->add(tag::create('input'))->att('type', 'text')->att('name', $name . '_lbl')->att('readonly', 'readonly');
$this->spanSrc = $this->add(tag::create('span'))->att('class', 'fa fa-search');
}
示例4: build
protected function build()
{
if ($lp = $this->get_par('label-position')) {
$this->panel->par('label-position', $lp);
}
if (!$this->get_par('disable-head')) {
$this->title = $this->add(tag::create('div'))->att('class', 'osy-panel-mobile-title');
$this->title->add(tag::create('span'))->att('class', 'osy-win-ico-set fright')->add(' ');
$this->title->add($this->get_par('label'));
}
}
示例5: __construct
public function __construct($name)
{
parent::__construct('dummy',$name);
env::$page->add_css(OSY_WEB_ROOT.'/css/leaflet.css');
env::$page->add_script(OSY_WEB_ROOT.'/js/component/omapgrid_openlayers.js');
$this->map = $this->add(tag::create('div'))->att('class','osy-mapgrid-openlayers');
$this->add(new HiddenBox($this->id.'_ne_lat'));
$this->add(new HiddenBox($this->id.'_ne_lng'));
$this->add(new HiddenBox($this->id.'_sw_lat'));
$this->add(new HiddenBox($this->id.'_sw_lng'));
$this->add(new HiddenBox($this->id.'_center'));
}
示例6: build
protected function build()
{
$this->add(tag::create('ul'));
//$this->iframe = $this->add(tag::create('iframe'));
//$this->iframe->att('name',$this->id)->att("style",'width: 100%;');
$src = $this->get_par('src');
if (!array_key_exists($this->id, $_REQUEST) && !empty($src)) {
$_REQUEST[$this->id] = $src;
}
if (array_key_exists($this->id, $_REQUEST) && !empty($_REQUEST[$this->id])) {
$this->att('src', $_REQUEST[$this->id]);
}
}
示例7: __construct
public function __construct($name)
{
parent::__construct('div', $name);
$this->att('class', 'osy-social');
Osy::$page->add_css(OSY_WEB_ROOT . '/css/Social.css');
Osy::$page->add_script(OSY_WEB_ROOT . '/js/component/Social.js');
$this->addRequire('css/Social.css');
$this->addRequire('js/component/Social.js');
$pst = $this->add(tag::create('div'))->att('class', 'osy-social-post');
$pst->add(new TextArea($name . '_post'))->att('class', 'osy-social-post');
$pst->add(tag::create('div'))->att('class', 'osy-social-post-canvas');
$pst->add(new Button($name . 'send'))->att('class', 'osy-social-send-post')->att('label', 'Post');
$this->add(tag::create('div'))->att('class', 'osy-social-body')->add('<ul class="notify">' . $this->printPostList($_REQUEST['_uid']) . '</ul>');
}
示例8: build
protected function build()
{
if (!empty($_REQUEST['ajax'])) {
die($this->ajaxResp());
}
if ($sql = $this->get_par('datasource-sql')) {
$this->dataLoad($sql);
}
$tbl = $this->add(tag::create('table'));
foreach ($this->data as $k => $rec) {
$tr = $tbl->add(tag::create('tr'))->att('data-param', base64_encode(serialize($rec)));
$td_prp = $tr->add(tag::create('td'))->att('class', 'osy-prop')->add($rec['p_label']);
$td_val = $tr->add(tag::create('td'))->att('class', 'osy-prop')->add(substr(htmlentities($rec['p_value']), 0, 100));
}
}
示例9: objects
public static function objects($oid = 'root', $par = null)
{
if (!array_key_exists($oid, self::$data)) {
return;
}
if (is_null($par)) {
$par = self::$xml;
}
foreach (self::$data[$oid] as $k => $rec) {
$obj = $par->add(tag::create($rec['o_typ']))->att('id', $rec['o_id']);
foreach ($rec as $pid => $pvl) {
$pvl = strpos($pvl, '&') === false && strpos($pvl, '<') === false && strpos($pvl, '>') === false ? $pvl : '<![CDATA[' . PHP_EOL . $pvl . PHP_EOL . ']]>';
$obj->add(tag::create('property'))->att('name', $pid)->add($pvl);
}
$sub = self::objects($rec['o_id'], $obj->add(tag::create('children')));
//if (empty($sub)) $obj->add(tag::create('childs'))->add($sub);
}
return $par;
}
示例10: __construct
public function __construct($name)
{
parent::__construct('dummy', $name);
//env::$page->add_css(OSY_WEB_ROOT.'/css/omapgrid.css');
//env::$page->add_script('http://maps.google.com/maps/api/js?sensor=false&language=en&libraries=drawing');
//env::$page->add_script('/lib/gmap3-6.0.0/gmap3.min.js');
//env::$page->add_script(OSY_WEB_ROOT.'/js/component/MapGridGmap.js');
$this->addRequire('css/omapgrid.css');
$this->addRequire('http://maps.google.com/maps/api/js?sensor=false&language=en&libraries=drawing');
$this->addRequire('/vendor/gmap3-6.0.0/gmap3.min.js');
$this->addRequire('js/component/MapGridGmap.js');
$this->map = $this->add(tag::create('div'))->att('class', 'osy-mapgrid');
$this->add(new HiddenBox($this->id . '_ne_lat'));
$this->add(new HiddenBox($this->id . '_ne_lng'));
$this->add(new HiddenBox($this->id . '_sw_lat'));
$this->add(new HiddenBox($this->id . '_sw_lng'));
$this->add(new HiddenBox($this->id . '_center'));
$this->add(new HiddenBox($this->id . '_polygon'));
$this->add(new HiddenBox($this->id . '_refresh_bounds_blocked'));
}
示例11: build
protected function build()
{
$head = $this->add(tag::create('ul'));
ksort($this->__tabs);
$it = 0;
foreach ($this->__tabs as $row) {
ksort($row);
foreach ($row as $cols) {
foreach ($cols as $obj) {
$prefix = is_object($obj['obj']) ? $obj['obj']->get_par('label-prefix') . ' ' : '';
$head->add('<li><a href="#' . $this->id . '_' . $it . '" idx="' . $it . '"><p><span>' . $prefix . $obj['lbl'] . "</span></p></a></li>\n");
$div = $this->add(tag::create('div'))->att('id', $this->id . '_' . $it);
if ($this->get_par('cell-height')) {
$h = intval($this->get_par('cell-height'));
$obj['obj']->att('style', 'height : ' . ($h - 30) . 'px');
}
$div->add($obj['obj']);
$it++;
}
}
}
}
示例12: build
protected function build()
{
$img = '';
//var_dump($_REQUEST[$this->id]);
if (!empty($_REQUEST[$this->id])) {
if ($inblob = $this->get_par('store-in-blob')) {
$img = '<img src="data:image/png;base64,' . base64_encode($_REQUEST[$this->id]) . '">';
} else {
$filename = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST[$this->id];
if (file_exists($filename)) {
$img = '<img src="' . $filename . '">';
}
}
if (!empty($img) && ($dim_max = $this->get_par('crop-dimension'))) {
$dim_img = getimagesize($filename);
$dim_max = explode(',', $dim_max);
if ($dim_max[0] < $dim_img[0] && $dim_max[1] < $dim_img[1]) {
$this->att('class', 'image-crop', true);
$this->add('<input type="hidden" id="' . $this->id . '_crop" name="' . $this->id . '_crop" class="osy-imagebox-crop">');
$prw = $this->add(tag::create('div'))->att('class', 'osy-imagebox-previewbox');
$prw->add('<div style="width: 140px; height: 140px; overflow: hidden;"><img src="' . $_REQUEST[$this->id] . '" class="osy-imagebox-preview"></div>');
$prw->add('<span id="' . $this->id . '_get_crop" class="osy-imagebox-cmd-crop btn_cnf w100 center"><span class="fa fa-cut"></span> Taglia</span>');
$this->add('<img src="' . $_REQUEST[$this->id] . '" class="osy-imagebox-master">');
return;
}
$this->add('<div><img src="' . $_REQUEST[$this->id] . '" class="osy-imagebox-master" title="' . $_REQUEST[$this->id] . '"></div>', true);
}
}
if ($dim = $this->get_par('max-dimension')) {
$dim = explode(',', $dim);
$sty = ' style="width:' . $dim[0] . 'px; height: ' . $dim[1] . 'px;"';
}
$this->add('<label class="osy-imagebox-dummy"' . $sty . ' for="' . $this->id . '_file">' . (empty($img) ? '<span class="fa fa-camera" ></span>' : $img) . '</label>');
if (!empty($img)) {
$this->add(tag::create('div'))->att('class', 'osy-imagebox-cmd center')->add(tag::create('a'))->att('href', 'javascript:void(0);')->att('onclick', "oimagebox.delete('" . $this->id . "')")->att('data-cmd', 'delete')->add('Elimina <span class="fa fa-trash"></span>');
}
//$this->add(tag::create('label'))->att('class','btn_add center')->att('for',$this->id.'_file')->add('Upload');
}
示例13: buildPie
private function buildPie($datasets)
{
$js .= (empty($js) ? '' : ",\n") . "{value : " . (array_key_exists(1, $rec) ? $rec[1] : 0) . ",color : '" . (!empty($this->_color[$k]) ? $this->_color[$k] : '') . "'}";
$tr = $this->legend->add(tag::create('tr'));
$tr->add(tag::create('td'))->att('style', 'padding: 5px;')->add('<span style="background-color: ' . $this->_color[$k] . '; padding: 0px 5px; border-radius: 1px; border: 2px solid whitesmoke;";> </span>');
$tr->add(tag::create('td'))->att('style', 'padding: 5px;')->add($rec[0]);
$tr->add(tag::create('td'))->att('style', 'padding: 5px;')->add($rec[1]);
$tr->add(tag::create('td'))->att('style', 'padding: 5px;')->add(round($rec[1] / $tot * 100, 2) . ' %');
$js = "var data = [\n" . $js . "\n];" . PHP_EOL;
$js .= "var ctx = document.getElementById('" . $this->canvas->id . "_canvas').getContext('2d');\r\n var chr = new Chart(ctx).Pie(data);";
return;
}
示例14: build
protected function build()
{
$sql = $this->get_par('datasource-sql');
if (empty($sql)) {
die('[ERROR] - Multibox ' . $this->id . ' - query builder assente');
}
$sql = $this->replacePlaceholder($sql);
$res = $this->db->exec_query($sql, null, 'ASSOC');
//die($sql);
if (empty($res)) {
return;
}
$mlt_tbl = $this->add(tag::create('table'));
$val_from_db = array_key_exists($this->id, $_REQUEST) && is_array($_REQUEST[$this->id]) ? false : true;
foreach ($res as $k => $cmp_raw) {
if ($val_from_db) {
$_REQUEST[$this->id][$cmp_raw['id']] = $cmp_raw['val'];
}
$mlt_row = $mlt_tbl->add(tag::create('tr'));
$cmp = $lbl = null;
if (strlen($this->readonly) > 4) {
$this->readonly = HelperOsy::exec_string(null, 'return ' . $this->readonly . ';');
}
if ($this->readonly) {
$cmp = tag::create('span');
if ($cmp_raw['typ'] == 'CMB') {
$cmp_raw['val'] = label::getFromDatasource($cmp_raw['val'], $cmp_raw['sql_qry'], $this->db);
}
$cmp->add($cmp_raw['val']);
} else {
$is_req = $cmp_raw['is_req'];
$cmp_nam = "{$this->id}[{$cmp_raw['id']}]";
switch ($cmp_raw['typ']) {
case 'DAT':
$cmp = new DateBox($cmp_nam);
$cmp->par('date-format', 'dd/mm/yyyy');
break;
case 'TXT':
case 'NUM':
$cmp = new TextBox($cmp_nam);
if ($cmp_raw['typ'] == 'NUM') {
$cmp->att('class', 'numeric', true);
} else {
$cmp->att('class', 'text', true);
}
break;
case 'CMB':
$cmp = new ComboBox($cmp_nam);
//echo $cmp_raw['sql_qry'];
$cmp->par('datasource-sql', HelperOsy::replaceVariable($cmp_raw['sql_qry']));
break;
}
$cmp->att('label', $cmp_raw['nam']);
if (!empty($is_req)) {
$lbl = '(*) ';
$cmp->att('class', 'is-request', true);
}
}
if (!is_null($cmp)) {
$lbl = "<label class=\"multibox\">{$lbl}{$cmp_raw['nam']}</label>";
$mlt_row->add(new Tag('td'))->add($lbl);
$mlt_row->add(new Tag('td'))->add($cmp);
}
}
}
示例15: buildAjax
public function buildAjax()
{
$form_pkey = array();
if ($form = $this->get_par('form-related')) {
$form_par = $this->getFormParam($form, true);
$form_pkey = $form_par['pkey'];
}
$tbl = new Tag('div');
$sql = $this->replacePlaceholder($this->get_par('datasource-sql'));
$rs = $this->db->exec_query("SELECT * FROM (" . $sql . ") a", null, 'ASSOC');
$cols = $this->db->get_columns();
foreach ($cols as $col) {
if ($col['name'] == '_group') {
$rs = $this->groupRs($rs);
}
}
$__g = '';
foreach ($rs as $rec) {
$tr = tag::create('div')->att('class', 'row');
$__k = array();
$_oid = array();
foreach ($rec as $key => $fld) {
$val = $fld;
if (in_array($key, $form_pkey)) {
$__k[] = 'pkey[' . $key . ']=' . $val;
$_oid[] = $val;
continue;
}
$print = true;
if ($key[0] == '_') {
$print = false;
switch ($key) {
case '_id':
$tr->att('data-oid', $val);
$print = false;
break;
case '_label':
$tr->att('data-label', $val);
$print = false;
break;
case '_group':
if ($val != $__g) {
$__g = $val;
} else {
$val = ' ';
}
$val = '<span class="osy-textsearch-inline-group">' . $val . '</span>';
$print = true;
break;
case '_img64x2':
$dimcls = 'osy-image-med';
//no-break
//no-break
case '_img64':
$val = '<span class="' . (empty($dimcls) ? 'osy-image-min' : $dimcls) . '">' . (empty($fld) ? '<span class="fa fa-ban"></span>' : '<img src="data:image/png;base64,' . base64_encode($fld) . '">') . '</span>';
$print = true;
break;
case '_label':
$tr->att('data-label', $val);
break;
}
}
if ($print) {
$tr->add(tag::create('div'))->add($val);
}
}
//$tr->add('<br class="clear">');
$tbl->add($tr);
if (!empty($__k)) {
$tr->att('data-pkey', implode('&', $__k));
$tr->att('data-oid', implode('&', $_oid));
}
}
return $tbl;
}