• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP f3函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中f3函数的典型用法代码示例。如果您正苦于以下问题:PHP f3函数的具体用法?PHP f3怎么用?PHP f3使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了f3函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:10,代码来源:reaction.php


示例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");
     }
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:16,代码来源:reaction.php


示例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;
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:40,代码来源:reaction.php


示例4: f2

function f2($b)
{
    $b = trim($b);
    $b = f3($b);
    //  secured{xss}{f2::$b}
    f1($b);
}
开发者ID:void-in,项目名称:SCARY,代码行数:7,代码来源:functions13.php


示例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));
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:14,代码来源:reaction.php


示例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']);
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:9,代码来源:reaction.php


示例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']);
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:10,代码来源:outfit.php


示例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']);
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:10,代码来源:outfit.php


示例9: main

function main()
{
    f1();
    f2();
    f3();
    f4();
    f5();
    f6();
    f7();
    f8();
}
开发者ID:n3b,项目名称:hiphop-php,代码行数:11,代码来源:extract.php


示例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;
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:11,代码来源:reaction.php


示例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';
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:24,代码来源:Sender.php


示例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;
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:24,代码来源:reaction.php


示例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']);
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:16,代码来源:reaction.php


示例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));
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:17,代码来源:Outfit.php


示例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);
开发者ID:badlamer,项目名称:hhvm,代码行数:19,代码来源:backtrace.php


示例16: f3

<?php

function f3(&$c)
{
    $c = htmlspecialchars($c);
    ## filtering permanently
}
f3($_GET['a']);
echo $_GET['a'];
# NOTHING
开发者ID:void-in,项目名称:SCARY,代码行数:10,代码来源:volatile2.php


示例17: var_dump

        var_dump($k, $v);
    }
}
function f5($x)
{
    switch ($x[0]) {
        case 0:
            var_dump($x[0]);
    }
}
function f6($x, $y, $z)
{
    if ($z) {
        goto my_clause;
    }
    if ($y) {
        var_dump($y);
    } else {
        if ($x[0]) {
            var_dump($x[0]);
            my_clause:
            var_dump($x);
        }
    }
}
f1(array(0, 0));
f2(array(10));
f3(array(10), false);
f4(array(array(1, 2, 3)));
f5(array(false, false));
f6(array(true), false, false);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:543.php


示例18: id

<?php

function id($x)
{
    return $x;
}
function f1($x)
{
    $z = id($x[0]);
    foreach ($x[0] as $a) {
        $z[] = array(id($z), count($x[0]));
    }
}
f1(array(array(0, 1, 2, 3)));
function f2($x)
{
    var_dump($x[0]);
    $y = 'foo' . $x[0] . 'bar';
}
f2('foobar');
function f3($x)
{
    $x = is_string($x[0]) ? $x[0] : get_class($x[0]);
    return $x;
}
var_dump(f3('abc'));
var_dump(f3(array(new stdClass())));
开发者ID:badlamer,项目名称:hhvm,代码行数:27,代码来源:539.php


示例19: g

echo 'f(10, 12) + g(15) = ' . (f(10, 12) + g(15)) . "\n";
echo 'f(10, 12) - g(15) = ' . (f(10, 12) - g(15)) . "\n";
echo 'f(10, 12) * g(15) = ' . f(10, 12) * g(15) . "\n";
echo 'f(10, 12) / g(15) = ' . f(10, 12) / g(15) . "\n";
function f1($a)
{
    echo "Inside f1\n";
    return $a;
}
function f2($a)
{
    echo "Inside f2\n";
    return $a;
}
function f3($a)
{
    echo "Inside f3\n";
    return $a;
}
function f4($a)
{
    echo "Inside f4\n";
    return $a;
}
$values = array(0, 1, 2, 3, 4, 5, 6);
var_dump($values);
$values[f1(4) - f2(2)] = $values[f3(3) * f4(2)];
var_dump($values);
$values = array(0, 1, 2, 3, 4, 5, 6);
$values[f1(1) + f2(2)] = $values[f3(6) / f4(3)];
var_dump($values);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:order_of_evaluation.php


示例20: serve

 /**
  * generates the pagination output
  * @return string
  */
 public function serve()
 {
     if (is_null($this->linkPath)) {
         $route = f3()->get('PARAMS.0');
         if (f3()->exists('PARAMS.' . $this->routeKey)) {
             $route = preg_replace("/" . f3()->get('PARAMS.' . $this->routeKey) . "\$/", '', $route);
         } elseif (substr($route, -1) != '/') {
             $route .= '/';
         }
     } else {
         $route = $this->linkPath;
     }
     f3()->set('pg.route', $route);
     f3()->set('pg.prefix', $this->routeKeyPrefix);
     f3()->set('pg.currentPage', $this->current_page);
     f3()->set('pg.nextPage', $this->getNext());
     f3()->set('pg.prevPage', $this->getPrev());
     f3()->set('pg.firstPage', $this->getFirst());
     f3()->set('pg.lastPage', $this->getLast());
     f3()->set('pg.rangePages', $this->getInRange());
     $output = \Template::instance()->render($this->template);
     f3()->clear('pg');
     return $output;
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:28,代码来源:pagination.php



注:本文中的f3函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fClose函数代码示例发布时间:2022-05-15
下一篇:
PHP f2函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap