本文整理汇总了PHP中f3函数的典型用法代码示例。如果您正苦于以下问题:PHP f3函数的具体用法?PHP f3怎么用?PHP f3使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了f3函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_get_zipcodes
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);
}
示例2: do_dl_csv
function do_dl_csv($f3, $args)
{
if (!rStaff::_isLogin()) {
return parent::_return(8001);
}
$rows = $this->_db->exec("SELECT * FROM `" . self::fmTbl() . "` ORDER BY insert_ts DESC ");
if (!$rows) {
header("Content-Type:text/html; charset=utf-8");
echo '無結果';
} else {
$template = new Template();
f3()->set('rows', $rows);
Outfit::_setXls("contact_" . date("YmdHis"));
echo $template->render('contact.dl.html', "application/vnd.ms-excel");
}
}
示例3: sort_menus
/**
* get menus in option mode
*
* @param int $parent_id - parent type id
* @param int $level - level number
* @param int $level_mod - level string mode
*
* @return array
*/
static function sort_menus($parent_id = 0, $level = 0, $level_mod = '', $flatten = 1)
{
$menus = f3()->get('menus');
if (empty($menus)) {
$menus = fMenu::get_menus();
f3()->set('menus', $menus);
}
$cates = array();
foreach ($menus as $row) {
if ($row['parent_id'] == $parent_id) {
if ($level_mod == '') {
$row['prefix'] = '';
} else {
$row['prefix'] = str_repeat($level_mod, $level + 1);
}
$row['level'] = $level;
$row['title'] = $row['prefix'] . $row['title'];
$subCates = self::sort_menus($row['id'], $level + 1, $level_mod, $flatten);
if ($flatten == 1) {
$cates[] = $row;
if (!empty($subCates)) {
$cates = array_merge($cates, $subCates);
}
} else {
$row['rows'] = $subCates;
$cates[] = $row;
}
}
}
return $cates;
}
示例4: f2
function f2($b)
{
$b = trim($b);
$b = f3($b);
// secured{xss}{f2::$b}
f1($b);
}
示例5: do_editor_upload
/**
* save photo
* @param object $f3 - $f3
* @param array $args - uri params
* @return array - std json
*/
function do_editor_upload($f3, $args)
{
rStaff::_chkLogin();
list($filename, $width, $height, $title) = Upload::savePhoto(f3()->get('FILES'), array(f3()->get('all_thn')));
$response = new \StdClass();
$response->link = f3()->get('uri') . $filename;
echo stripslashes(json_encode($response));
}
示例6: do_click
function do_click($f3, $args)
{
$row = fAdv::get_row(f3()->get('GET.id'));
if ($row == null) {
f3()->error(404);
}
fAdv::save_col(array('pid' => $row['id'], 'col_name' => 'counter', 'val' => $row['counter'] + 1));
f3()->reroute($row['uri']);
}
示例7: do_preview
function do_preview($f3, $args)
{
rStaff::_chkLogin();
$cu = fPress::get_row('/' . $args['slug'], 'slug', '', true);
if (empty($cu)) {
f3()->error(404);
}
f3()->set('cu', $cu);
parent::wrapper('press/content.html', $cu['title'], '/press' . $cu['slug']);
}
示例8: do_privacy
function do_privacy($f3, $args)
{
$cu = fPost::get_row('/privacy', 'slug', " AND `status`='" . fPost::ST_ON . "' ");
if (empty($cu)) {
f3()->error(404);
}
f3()->set('cu', $cu);
f3()->set('bc_ary', array(array('link' => 'javascript:;', 'title' => $cu['title'])));
parent::wrapper('post.html', $cu['title'], $cu['slug']);
}
示例9: main
function main()
{
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
}
示例10: _CStaff
static function _CStaff($column = 'id')
{
$cu = f3()->get('SESSION.cs');
$str = "";
if (isset($cu)) {
if (isset($cu[$column])) {
$str = $cu[$column];
}
}
return $str;
}
示例11: mail
/**
* mail
*
* @param string $subject
* @param string $content
* @param email $receiver
*
* @return none
*/
static function mail($subject, $content, $receiver = "")
{
$to_address = $receiver == "" ? f3()->get('inquiry_receiver') : $receiver;
$from_address = f3()->get('smtp_account');
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
$from_name = "=?UTF-8?B?" . base64_encode(f3()->get('smtp_name')) . "?=";
$headers = "Content-Type: text/html; charset=\"utf8\" Content-Transfer-Encoding: 8bit \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "From:" . $from_address . "(" . $from_name . ")\r\n";
if ($to_address != $from_address) {
$headers .= "bcc:" . f3()->get('inquiry_receiver') . "\r\n";
}
mail($to_address, $subject, $content, $headers);
return 'Done';
}
示例12: breadcrumb_categories
/**
* get categories in breadcrumb mode
*
* @param int $parent_id - parent type id
* @param int $level - level number
*
* @return array
*/
static function breadcrumb_categories($parent_id = 0, $level = 0)
{
$categories = f3()->get('categories');
if (empty($categories)) {
$categories = fCategory::get_categories();
f3()->set('categories', $categories);
}
$cates = array();
foreach ($categories as $row) {
if ($row['id'] == $parent_id) {
$row['parentCate'] = self::breadcrumb_categories($row['parent_id'], $level + 1);
$cates = $row;
}
}
return $cates;
}
示例13: do_save_new_schedules
function do_save_new_schedules($f3, $args)
{
$allData = json_decode(f3()->get('SESSION.uploadPrograms'), true);
db()->begin();
foreach ($allData['schedules'] as $prog) {
$program = Program::get_program_by_codename($prog['c']);
if (empty($program)) {
$program['title'] = $prog['c'];
$program['uri'] = '';
$program['id'] = 0;
}
db()->exec("INSERT INTO `" . tpf() . "schedules`(`title`, `uri`, `program_id`, `start_date`, `end_date`, `status`, `last_ts`, " . "`last_user`, `insert_user`, `insert_ts`) VALUES ('" . $program['title'] . "', '" . $program['uri'] . "', '" . $program['id'] . "', '" . $prog['d'] . " " . $prog['s'] . ":00', '" . $prog['d'] . " " . $prog['e'] . ":00', 'Yes', '" . date('Y-m-d H:i:s') . "', '" . rStaff::_CStaff('id') . "', '" . rStaff::_CStaff('id') . "', '" . date('Y-m-d H:i:s') . "')");
}
db()->commit();
return parent::_return(1, $allData['schedules']);
}
示例14: wrapper
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));
}
示例15: f1
<?php
function f1()
{
debug_print_backtrace();
}
function f2($arg1, $arg2)
{
f1();
yield;
// force generator
}
function f3($gen)
{
$gen->rewind();
// trigger run
}
$gen = f2('foo', 'bar');
f3($gen);