本文整理汇总了PHP中GCore\Helpers\Html::_concat方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::_concat方法的具体用法?PHP Html::_concat怎么用?PHP Html::_concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCore\Helpers\Html
的用法示例。
在下文中一共展示了Html::_concat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute(&$form, $action_id)
{
$config = $form->actions_config[$action_id];
$config = new \GCore\Libs\Parameter($config);
$field = $config->get('field', '');
$data_path = $config->get('data_path', '');
$value = $config->get('value_key', 'value');
$prepend = $config->get('prepend_value', true);
$text = $config->get('text_key', 'text');
$level = $config->get('level_key', '');
$labels = $config->get('labels', 'L1,L2,L3,L4');
$limit = $config->get('limit', 999);
$placeholder = $config->get('placeholder', 'Procurar...');
$res = array();
if (!empty($field) && !empty($data_path) && !empty($text) && !empty($value)) {
$treeList = self::mount_tree($form->data[$data_path], $value, $prepend, $text, $level);
self::mount_list($treeList, explode(',', $labels), $value, $text, $res);
$list = implode("\n", $res);
$clean_attrbs = array('type' => 'button', 'value' => 'Limpar', 'id' => 'limpar');
$search_attrbs = array('type' => 'text', 'name' => 'busca', 'id' => 'busca', 'placeholder' => $placeholder, 'size' => '20');
$clean = \GCore\Helpers\Html::_concat($clean_attrbs, array_keys($clean_attrbs), '<input ', ' />');
$search = \GCore\Helpers\Html::_concat($search_attrbs, array_keys($search_attrbs), '<input ', ' />');
$arvore = '<div id="arvore">' . $list . '</div>';
$c_busca = \GCore\Helpers\Html::container('div', $search . $clean, array('id' => 'c_busca'));
$modal_div = \GCore\Helpers\Html::container('div', $c_busca . $arvore, array('id' => 'modal_arvore', 'style' => array('display' => 'none')));
$doc = \GCore\Libs\Document::getInstance();
$doc->addCssFile('vendors/vakata-jstree/themes/default/style.min.css');
$doc->addCssFile('vendors/jquery-ui-1.11.4/jquery-ui.min.css');
$doc->addJsFile('vendors/vakata-jstree/jstree.min.js');
$doc->addJsFile('vendors/jquery-ui-1.11.4/jquery-ui.min.js');
$fieldKey = $this->getFieldKey($form->form['Form']['extras']['fields'], $field);
$campo = $form->form['Form']['extras']['fields'][$fieldKey];
$condicoes = $config->get('conditions', "");
if (!empty($condicoes)) {
$condicoes = explode("\n", $condicoes);
foreach ($condicoes as $condicao) {
$condicao = explode("::", $condicao);
// $condicao[0]: Condição; $condicao[1]: Mensagem
$elseifs = ' else if (' . $condicao[0] . ')' . '{ alert("' . $condicao[1] . '"); event.preventDefault(); return false; }';
}
} else {
$elseifs = '';
}
$opcoes = array('{field}' => $field, '{fieldID}' => $campo['id'], '{label}' => $campo['label']['text'], '{limit}' => empty($limit) || is_null($limit) ? 999 : $limit, '{condicoes}' => $elseifs);
$doc->addJsCode($this->get_script($opcoes));
$doc->addCssCode($this->get_style($campo['id']));
$form->form['Form']['content'] = str_replace('<div id="modal_tree" style="display: none;"></div>', $modal_div, $form->form['Form']['content']);
}
// echo 'Field name: ' . $field . '<br/>';
// echo 'Chave: ' . array_search($field, array_column($form->form['Form']['extras']['fields'], 'name'));
}
示例2: html_label
public static function html_label($params = array(), $f_params = array())
{
$attributes = array('for', 'class', 'id');
//$class = 'gform-label-'.$params['position'].' control-label';
if (!empty($params['sub'])) {
$class = 'help-block';
$tag = 'span';
} else {
$class = '';
$tag = 'label';
if (!empty($params['position']) and $params['position'] == 'left') {
$class .= ' gcore-label-left';
} else {
$class .= ' gcore-label';
}
if (in_array($f_params['type'], array('checkbox', 'checkbox_group', 'radio'))) {
$class .= ' gcore-label-checkbox';
}
}
$params['class'] = $class;
return \GCore\Helpers\Html::_concat($params, $attributes, '<' . $tag . ' ', '>' . $params['text'] . '</' . $tag . '>');
}
示例3: _renderHeader
function _renderHeader()
{
$chunks = array($this->doc->getBase(), $this->doc->getMeta(), $this->doc->getTitle(), $this->doc->getFavicon());
//add css files list
foreach ($this->doc->cssfiles as $cssfile) {
$chunks[] = \GCore\Helpers\Html::_concat($cssfile, array_keys($cssfile), '<link ', ' />');
}
//add css code list
foreach ($this->doc->csscodes as $media => $codes) {
$chunks[] = \GCore\Helpers\Html::container('style', implode("\n", $codes), array('type' => 'text/css', 'media' => $media));
}
//add js files list
foreach ($this->doc->jsfiles as $jsfile) {
$chunks[] = \GCore\Helpers\Html::_concat($jsfile, array_keys($jsfile), '<script ', '></script>');
}
//add js code list
foreach ($this->doc->jscodes as $type => $codes) {
$chunks[] = \GCore\Helpers\Html::container('script', implode("\n", $codes), array('type' => $type));
}
foreach ($this->doc->headertags as $k => $code) {
$chunks[] = $code;
}
return implode("\n", array_filter($chunks));
}
示例4: getFavicon
function getFavicon()
{
$data = array('rel' => 'shortcut icon', 'href' => \GCore\Helpers\Assets::image('favicon.ico'));
return \GCore\Helpers\Html::_concat($data, array_keys($data), '<link ', ' />');
}
示例5: getHeader
public static function getHeader()
{
$doc = \GCore\Libs\Document::getInstance();
static $used;
if (!isset($used)) {
$used = array();
}
$chunks = array();
$chunks[] = '
<script type="text/javascript">
if("undefined"==typeof window.jQuery){}else{
var gcore_jQuery_bak = window.jQuery;
var gcore_$_bak = window.$;
}
if("undefined"==typeof gcore_jQuery){}else{
window.jQuery = gcore_jQuery;
window.$ = gcore_$;
}
</script>
';
//add css files list
foreach ($doc->cssfiles as $k => $cssfile) {
//if(empty($used['cssfiles'][$k])){
$used['cssfiles'][$k] = true;
$chunks[] = \GCore\Helpers\Html::_concat($cssfile, array_keys($cssfile), '<link ', '>');
//}
}
//add css code list
foreach ($doc->csscodes as $media => $codes) {
$chunks[] = \GCore\Helpers\Html::container('style', implode("\n", $codes), array('type' => 'text/css', 'media' => $media));
foreach ($doc->csscodes[$media] as $k => $code) {
unset($doc->csscodes[$media][$k]);
}
}
//add js files list
foreach ($doc->jsfiles as $k => $jsfile) {
/*if(strpos($jsfile['src'], 'jquery.js') !== false){
$document = \JFactory::getDocument();
$document->addScript($jsfile['src']);
continue;
}*/
//if(empty($used['jsfiles'][$k])){
$used['jsfiles'][$k] = true;
$chunks[] = \GCore\Helpers\Html::_concat($jsfile, array_keys($jsfile), '<script ', '></script>');
//}
}
//add js code list
foreach ($doc->jscodes as $type => $codes) {
$chunks[] = \GCore\Helpers\Html::container('script', implode("\n", $codes), array('type' => $type));
foreach ($doc->jscodes[$type] as $k => $code) {
unset($doc->jscodes[$type][$k]);
}
}
foreach ($doc->headertags as $k => $code) {
$chunks[] = $code;
unset($doc->headertags[$k]);
}
$chunks[] = '
<script type="text/javascript">
if("undefined"==typeof gcore_jQuery){
var gcore_jQuery = window.jQuery;
var gcore_$ = window.$;
}
if("undefined"==typeof gcore_jQuery_bak){}else{
window.jQuery = gcore_jQuery_bak;
window.$ = gcore_$_bak;
}
</script>
';
return implode("\n", array_filter($chunks));
}