本文整理汇总了PHP中theme::element方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::element方法的具体用法?PHP theme::element怎么用?PHP theme::element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme
的用法示例。
在下文中一共展示了theme::element方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: open_form
public static function open_form($attr = [])
{
$defaults['action'] = '/capture-handler';
$defaults['method'] = 'post';
$defaults['accept-charset'] = 'UTF-8';
$defaults['enctype'] = 'application/x-www-form-urlencoded';
$defaults['autocomplete'] = 'off';
$defaults['novalidate'] = '';
$defaults['data-parsley-validate'] = '';
$defaults['class'] .= trim('js-parsley ' . $attr['class']);
$defaults['success'] = '/' . ci()->uri->uri_string();
$defaults['fail'] = '/' . ci()->uri->uri_string();
$defaults['name'] = 'None Set';
$attr = array_diff_key($defaults, $attr) + array_intersect_key($attr, $defaults);
$name = $attr['name'];
$success = $attr['success'];
$fail = $attr['fail'];
$honey_pot = 'team_name';
unset($attr['name']);
unset($attr['success']);
unset($attr['fail']);
$html = theme::element('form', $attr);
$html .= '<input type="hidden" name="_form_name" value="' . theme::hash($name) . '">';
$html .= '<input type="hidden" name="_success_goto" value="' . theme::hash($success) . '">';
$html .= '<input type="hidden" name="_fail_goto" value="' . theme::hash($fail) . '">';
$html .= '<div class="capture_field"><input name="' . $honey_pot . '" value=""></div>';
return $html;
}
示例2: dropdown
public static function dropdown($name, $value, $extra = [])
{
$defaults = ['name' => $name, 'style' => '', 'id' => $name, 'class' => ''];
$list = array_merge($defaults, $extra);
$list['class'] .= ' select3';
$empty = $extra['empty'];
unset($extra['empty']);
$fa = self::awesomeness();
$fa = array_combine($fa, $fa);
echo theme::element('select', $list);
if ($empty) {
echo '<option value="" selected> </option>';
}
foreach ($fa as $fa) {
$selected = $value == $fa && $empty == FALSE ? ' selected' : '';
echo '<option ' . $selected . ' value="' . $fa . '" data-icon="fa fa-' . $fa . '">' . ucwords(str_replace(['fa-', '-o'], '', $fa)) . '</option>';
}
echo '</select>';
}
示例3: uniqid
<?php
$index = 'id' . uniqid();
theme::element('div', ['id' => $index, 'class' => 'magic-row']);
theme::element('div', ['style' => 'width:95%', 'class' => 'portal-cell']);
theme::hidden('t_orange_c[' . $index . '][id]', $record->id);
theme::hidden('t_orange_c[' . $index . '][parent_id]', $record->parent_id);
theme::start_form_section('Name');
theme::text('t_orange_c[' . $index . '][name]', $record->name);
theme::end_form_section();
theme::start_form_section('Age', 2);
theme::text('t_orange_c[' . $index . '][age]', $record->age);
theme::end_form_section();
theme::element('/div');
theme::element('div', ['style' => 'width:5%', 'class' => 'portal-cell portal-cell-action']);
//theme::table_action('edit',$this->controller_path.'/xedit/'.$record->id,['class'=>'js-o_dialog','data'=>['redirect'=>'true','heading'=>'Leave this record?','text'=>'If you edit this record you will leave the current record.']]);
o_dialog::confirm_a_delete($this->controller_path . '/delete_child/' . $parent_id . '/' . $record->id, ['div' => $index]);
theme::element('/div');
theme::element('/div');