当前位置: 首页>>代码示例>>PHP>>正文


PHP Flight::get方法代码示例

本文整理汇总了PHP中Flight::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::get方法的具体用法?PHP Flight::get怎么用?PHP Flight::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Flight的用法示例。


在下文中一共展示了Flight::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * PRedis constructor.
  *
  * @param array $conf
  * @param $options
  */
 public function __construct($conf = [], $options = null)
 {
     if (!$conf) {
         $conf = \Flight::get('config')->get('redis');
     }
     parent::__construct($conf, $options);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:13,代码来源:PRedis.php

示例2: __construct

 /**
  * Constructor
  */
 public function __construct($install)
 {
     parent::__construct($install);
     if (F::has('pageinfos')) {
         F::view()->assign(array('pageinfos' => Files::getPageInfos(F::get('pageinfos')['cat'], F::get('pageinfos')['page'])));
     }
 }
开发者ID:ray0be,项目名称:fastdoc,代码行数:10,代码来源:DocController.php

示例3: getselectfields

 /**
  * Gets fields/columns from specified tables and generates dropdown options
  */
 public function getselectfields()
 {
     $tablesJSON = $_POST['tables'];
     if ($tablesJSON) {
         $html = '';
         $tables = json_decode($tablesJSON, true);
         foreach ($tables as $table) {
             // table columns
             $stmt = Flight::get('db')->query("DESCRIBE {$table}");
             $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
             //pretty_print($columns);
             $fields = array();
             foreach ($columns as $values) {
                 if (isset($values['Field'])) {
                     $fields[] = $values['Field'];
                 }
             }
             //pretty_print($fields);
             $html .= '<optgroup label="' . $table . '">' . "\n";
             $html .= getOptions($fields, false, $table);
             $html .= '</optgroup>' . "\n";
         }
         echo $html;
     }
 }
开发者ID:bubach,项目名称:VisualQuery,代码行数:28,代码来源:ajax.php

示例4: render_boilerplate

function render_boilerplate()
{
    Flight::render('head', array('my_url' => MY_URL, 'title' => _('WLAN at ') . PAGE_NAME), 'head');
    Flight::render('foot', array('privacy_url' => MY_URL . 'privacy/', 'imprint_url' => IMPRINT_URL), 'foot');
    Flight::render('back_to_code_widget', array('retry_url' => Flight::get('retry_url')), 'back_to_code_widget');
    Flight::render('access_code_widget', array('codeurl' => MY_URL . 'access_code/'), 'access_code_widget');
}
开发者ID:monat78,项目名称:fbwlan,代码行数:7,代码来源:fb_handlers.php

示例5: __construct

 public function __construct()
 {
     new Model_Test();
     include "test.html";
     $tmp = Flight::get('test');
     echo "Controller_Test" . $tmp;
 }
开发者ID:LukaszPapierz,项目名称:psi2,代码行数:7,代码来源:Test.php

示例6: __construct

 /**
  * AssetsManager constructor.
  * @param array $conf
  */
 public function __construct($conf = [])
 {
     if (!$conf) {
         $conf = \Flight::get('config')->get('assets');
     }
     $this->loadConfig($conf);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:11,代码来源:AssetsManager.php

示例7: get

 public function get($key)
 {
     if ($val = parent::get($key)) {
         return $val;
     }
     return Flight::has($key) ? Flight::get($key) : null;
 }
开发者ID:newmediakassel,项目名称:website015,代码行数:7,代码来源:index.php

示例8: saveProfile

 /**
  * Save properties of the user profile
  * @return [JSON] Success or error message
  */
 public static function saveProfile()
 {
     if (!Flight::has('currentUser')) {
         Flight::json(['Error' => 'No Access']);
     }
     $currentUser = Flight::get('currentUser');
     if (isset(Flight::request()->query->bio)) {
         $currentUser->bio = Flight::request()->data->bio;
     } else {
         if (isset(Flight::request()->query->password)) {
             if (!isset(Flight::request()->data->passwordold) || !isset(Flight::request()->data->passwordnew1) || !isset(Flight::request()->data->passwordnew2)) {
                 Flight::json(['success' => false, 'exception' => 'Empty fields']);
             }
             if ($currentUser->password === hash("sha256", Flight::request()->data->passwordold)) {
                 if (Flight::request()->data->passwordnew1 == Flight::request()->data->passwordnew2) {
                     $currentUser->password = hash("sha256", Flight::request()->data->passwordnew1);
                 } else {
                     Flight::json(['success' => false, 'exception' => 'New passwords are not the same']);
                 }
             } else {
                 Flight::json(['success' => false, 'exception' => 'Old password is not correct ']);
             }
         }
     }
     $result = $currentUser->update();
     if ($result != false) {
         $_SESSION['user'] = Flight::users()->getUserWithId(Flight::get('currentUser')->id);
         Flight::json(['success' => true]);
     } else {
         Flight::json(['sucess' => false, 'exception' => 'An error']);
     }
 }
开发者ID:happyoniens,项目名称:Blog,代码行数:36,代码来源:userController.php

示例9: access

 /**
  * Login POST verification (authentication)
  */
 public function access()
 {
     $pass = F::request()->data->password;
     # captcha
     if (!empty(F::get('config')['recaptcha']['public'])) {
         $captcha = F::request()->data['g-recaptcha-response'];
         if (!Verif::okCaptcha($captcha)) {
             $_SESSION['flashbag'] = '<div class="alert alert-danger">Wrong security captcha.</div>';
             $this->index();
             exit;
         }
     }
     # password
     if (Verif::okPassword($pass)) {
         $_SESSION['admin'] = 1;
         $_SESSION['flashbag'] = '
         <div class="alert alert-success alert-dismissible">
             <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
             You are now logged in.
         </div>';
         F::redirect('/');
     } else {
         $_SESSION['flashbag'] = '<div class="alert alert-danger">Wrong password.</div>';
     }
     $this->index();
 }
开发者ID:ray0be,项目名称:fastdoc,代码行数:29,代码来源:Login.php

示例10: smarty_function_res

function smarty_function_res($params, &$smarty)
{
    if (empty($params['path'])) {
        return "[plugin:res] missing parameter.";
    }
    return \Flight::get('root') . 'web/' . $params['path'];
}
开发者ID:ray0be,项目名称:fastdoc,代码行数:7,代码来源:function.res.php

示例11: __construct

 public function __construct()
 {
     try {
         $this->pdo = new PDO('mysql:host=' . Flight::get('DBhost') . ';dbname=' . Flight::get('DBname'), Flight::get('DBlogin'), Flight::get('DBpassword'));
     } catch (PDOException $e) {
         echo 'Po³¹czenie nie mog³o zostaæ utworzone.<br />';
     }
 }
开发者ID:LukaszPapierz,项目名称:psi2,代码行数:8,代码来源:Dao.php

示例12: __construct

 /**
  * DataPool constructor.
  * @param array $conf
  */
 public function __construct($conf = [])
 {
     if (!$conf) {
         $conf = \Flight::get('config')->get('datapool');
         $conf['debug'] = isDebug();
     }
     $this->dataPool = new DefaultDataPool($conf, ROOT);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:12,代码来源:DataPool.php

示例13: createPost

 /**
  * Create a post
  */
 public static function createPost()
 {
     if (!Flight::has('currentUser')) {
         Flight::redirect('/');
     }
     $post = new post(['user' => Flight::get('currentUser')->id, 'title' => Flight::request()->data->title, 'content' => Flight::request()->data->content]);
     $post->store();
 }
开发者ID:happyoniens,项目名称:Blog,代码行数:11,代码来源:postController.php

示例14: __construct

 /**
  * Timer constructor.
  * @param array $conf
  */
 public function __construct($conf = [])
 {
     if (!$conf) {
         $tz = \Flight::get('config')->get('timezone');
         $conf = ['timezone' => $tz];
     }
     $this->loadConfig($conf);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:12,代码来源:Timer.php

示例15: __construct

 public function __construct($paths, $pattern)
 {
     $this->paths = $paths;
     $this->pattern = $pattern;
     $this->ignores = $this->update_ignores(\Flight::setting("ignores"));
     $settings = \Flight::get("organizer.settings");
     $settings["ignores"] = $this->ignores;
     \Flight::write_settings($settings);
 }
开发者ID:raws,项目名称:sf-organizer,代码行数:9,代码来源:explorer.php


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