public function __construct() { //视图初始化 $this->tpl = tpl::getInstance(C('tpl')); //预留初始化 if (method_exists($this, 'init')) { $this->init(); } }
public static function renderFields($fields) { spl_autoload_register(array('field', 'autoloader_field'), FALSE, TRUE); $data = $options = $data['fields'] = $sort_order = array(); foreach ($fields as $key => $value) { $sort_order[$key] = $value['weight']; } array_multisort($sort_order, SORT_ASC, $fields); foreach ($fields as $field_id => $field_info) { if (!$field_info['status']) { continue; } $action = self::getAction($field_info['type']['type']); if (!empty($action['class'])) { $data['fields'][] = $action['class']::getInstance($field_info)->render(); } } $last_form_id = oc::registry()->config->get('quick_order_pro_last_form_id'); if (!empty($last_form_id)) { $options = id::decode($last_form_id); $data += $options; } return tpl::getInstance(tpl::find('fields', $options), $data)->render(); }