本文整理汇总了PHP中GCore\Helpers\Html::addClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::addClass方法的具体用法?PHP Html::addClass怎么用?PHP Html::addClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCore\Helpers\Html
的用法示例。
在下文中一共展示了Html::addClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trs
public static function trs($depth = 0)
{
$trs = array();
foreach (\GCore\Helpers\DataPresenter::$cells_data as $k => $column_data) {
$tds = array();
$row = \GCore\Helpers\DataPresenter::$cells_rows[$k];
foreach (\GCore\Helpers\DataPresenter::$columns as $column) {
$data = $column_data[$column];
$info = !empty(\GCore\Helpers\DataPresenter::$columns_info[$column]) ? \GCore\Helpers\DataPresenter::$columns_info[$column] : array();
$indent_class = '';
/*if(!empty(\GCore\Helpers\DataPresenter::$config['children']) AND \GCore\Helpers\DataPresenter::$config['indent_column'] == $column){
$indent_class = " depth-".$depth;
}*/
$class = !empty($info['class']) ? \GCore\Helpers\Html::addClass($info['class'], "td-" . $column . $indent_class) : "td-" . $column . $indent_class;
$tds[] = \GCore\Helpers\Html::container('td', $data, array("class" => $class, "style" => empty($info['style']) ? '' : \GCore\Helpers\Html::styles($info['style'])));
}
self::$count = 1 - self::$count;
$row['k'] = $k;
$tr_contents = \GCore\Libs\Str::replacer(implode("\n", $tds), $row, array('escape' => true));
//$tr_contents = \GCore\Helpers\DataLoader::load($tr_contents, $row);
$trs[] = \GCore\Helpers\Html::container('tr', $tr_contents, array("class" => "row" . self::$count . " tr-list-" . self::$count));
//check children
/*if(!empty(\GCore\Helpers\DataPresenter::$config['children'])){
$children = \GCore\Libs\Arr::getVal($row, array(\GCore\Helpers\DataPresenter::$config['model_alias'], 'children'));
if(!empty($children)){
$trs = array_merge($trs, self::trs($children, $depth + 1));
}
}*/
}
return $trs;
}
示例2: html_input
public static function html_input($name, $params = array())
{
if (!in_array($params['type'], array('radio', 'checkbox', 'checkbox_group'))) {
$params['class'] = \GCore\Helpers\Html::addClass(array('form-control'), $params['class']);
}
if (in_array($params['type'], array('file'))) {
$params['class'] = \GCore\Helpers\Html::addClass(array('gcore-height-auto'), $params['class']);
}
if (!array_intersect(explode(' ', $params['class']), array('A', 'F', 'SSS', 'SS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'))) {
$params['class'] = \GCore\Helpers\Html::addClass(array('A'), $params['class']);
}
return \GCore\Helpers\Html::html_input($name, $params);
}
示例3: html_formInput
public static function html_formInput($name, $params = array(), $formInputParams = array())
{
$fixed_width_classes = array_intersect(explode(' ', $params['class']), array('A', 'SSS', 'SS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'));
if (!$fixed_width_classes) {
$fixed_width_classes = array('A');
$params['class'] = \GCore\Helpers\Html::addClass($fixed_width_classes, $params['class']);
}
if (!empty($params['inputs'])) {
$inputs = array();
foreach ($params['inputs'] as $sub_input) {
if (!empty($sub_input['name'])) {
$generated_input = \GCore\Helpers\Html::formLine($sub_input['name'], $sub_input);
$inputs[] = $generated_input;
}
}
$input = implode("\n", $inputs);
} else {
$input = self::html_input($name, $params);
}
//$input = str_replace('gcore-radio-item', 'gcore-radio-item ui radio checkbox', $input);
//$input = str_replace('gcore-checkbox-item', 'gcore-checkbox-item ui checkbox', $input);
if ($params['type'] == 'multi') {
return $input;
}
$tags = array();
$input_class = array('ui', 'left', 'input');
$input_class[] = 'gcore-display-table';
if (!empty($params['horizontal'])) {
$input_class[] = 'gcore-multiple-column';
}
$input_class[] = implode(' ', $fixed_width_classes);
if (in_array($params['type'], array('button', 'reset', 'submit'))) {
$input_class = array('ui', 'left');
}
$input_attachments = array();
if (!empty($params['icon'])) {
$input_class[] = 'icon';
$input_attachments[] = $params['icon'];
}
if (!empty($params['labeled'])) {
$input_class[] = 'labeled';
$input_attachments[] = '<div class="ui corner label">' . $params['labeled'] . '</div>';
}
$tags[] = '<div class="' . implode(' ', $input_class) . '">';
$tags[] = $input;
$tags = array_merge($tags, $input_attachments);
$tags[] = '</div>';
return implode("\n", $tags);
}
示例4: html_input
public static function html_input($name, $params = array())
{
if (!in_array($params['type'], array('radio', 'checkbox', 'checkbox_group', 'submit', 'button', 'reset'))) {
$params['class'] = \GCore\Helpers\Html::addClass(array('form-control'), $params['class']);
}
if (in_array($params['type'], array('file'))) {
$params['class'] = \GCore\Helpers\Html::addClass(array('gcore-height-auto'), $params['class']);
}
if (in_array($params['type'], array('radio', 'checkbox_group'))) {
$params['label_input'] = true;
}
if (!array_intersect(explode(' ', $params['class']), array('A', 'F', 'SSS', 'SS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'))) {
//$params['class'] = \GCore\Helpers\Html::addClass(array('A'), $params['class']); //bspure fix
}
$return = \GCore\Helpers\Html::html_input($name, $params);
//bspure fix
if (in_array($params['type'], array('multi'))) {
$return .= '<div class="clearfix"></div>';
}
return $return;
}