function do_get_zipcodes($f3, $args) { $zipcodes = fOption::load_zipcodes(f3()->get('POST')['query']); $rtn = array(); $rtn['html'] = '<option value="">請選擇</option>'; foreach ($zipcodes as $value) { $rtn['html'] .= '<option value="' . $value['town'] . ' ' . $value['zipcode'] . '">' . $value['town'] . ' ' . $value['zipcode'] . '</option>'; } return parent::_return(1, $rtn); }
static function wrapper($html, $title = "", $slug = "") { f3()->set('canonical', $slug); $page = fOption::load('page'); if (!f3()->exists('page')) { f3()->set('page', $page); } f3()->set('page.title', $title . ($title != '' ? ' | ' : '') . $page['title']); f3()->set('social', fOption::load('social')); f3()->set('menus', rMenu::sort_menus(0, 0, '', 0)); $tp = \Template::instance(); $tp->filter('nl2br', '\\F3CMS\\Outfit::nl2br'); $tp->filter('crop', '\\F3CMS\\Outfit::crop'); $tp->filter('date', '\\F3CMS\\Outfit::date'); $tp->filter('str2tbl', '\\F3CMS\\Outfit::str2tbl'); echo self::minify($tp->render($html)); }
function get_option($key, $lang_id = null) { $lang_id = $lang_id ? $lang_id : 0; return fOption::get_option($key, $lang_id); }