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


PHP Flight::has方法代码示例

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


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

示例1: __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

示例2: 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

示例3: 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

示例4: 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

示例5: getLang

function getLang()
{
    if (!isset($_COOKIE["extractLang"])) {
        setLang('it');
    }
    if (Flight::has('lang')) {
        return Flight::get('lang');
    }
    return $_COOKIE["extractLang"];
}
开发者ID:tyrasd,项目名称:estratti-locali-openstreetmap,代码行数:10,代码来源:lang.php

示例6: checkInstall

 /**
  * check if the install process have been done
  */
 private function checkInstall($install)
 {
     if (F::has('password')) {
         if (!$install && empty(F::get('password'))) {
             F::redirect('/install');
         } elseif ($install && !empty(F::get('password'))) {
             F::redirect('/login');
         }
     }
 }
开发者ID:ray0be,项目名称:fastdoc,代码行数:13,代码来源:Controller.php

示例7: author

 public static function author($id = null)
 {
     if ($id == null) {
         if (Flight::has('currentUser')) {
             $user = Flight::get('currentUser');
         } else {
             Flight::redirect("/");
         }
     } else {
         $user = Flight::users()->getUserWithId($id);
     }
     Flight::util()->render('profile', ['user' => $user]);
 }
开发者ID:happyoniens,项目名称:Blog,代码行数:13,代码来源:viewController.php

示例8: page

 /**
  * Reading / Editing page
  */
 public function page($params)
 {
     $mode = $params[0];
     $pageinfos = F::get('pageinfos');
     if (empty($pageinfos['cat'])) {
         $pageTitle = F::get('config')['document'];
         $url_view = '{$root}';
         $url_edit = '{$root}.edit';
         $path = 'docs/.home';
     } else {
         $pageTitle = Files::getPageTitle($pageinfos['cat'], $pageinfos['page']);
         $url_view = '{$root}' . $pageinfos['cat'] . '/' . $pageinfos['page'];
         $url_edit = '{$root}' . $pageinfos['cat'] . '/' . $pageinfos['page'] . '.edit';
         $path = 'docs/' . $pageinfos['cat'] . '/' . $pageinfos['page'];
     }
     if (file_exists($path) && is_file($path) && is_readable($path)) {
         $pageContent = file_get_contents($path);
         # Edit mode
         if ($mode == 'edit' && F::has('admin')) {
             # Content submited
             if (F::request()->method == 'POST') {
                 $pageContent = F::request()->data->pageContent;
                 file_put_contents($path, $pageContent);
                 $_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>
                     The page has been saved
                 </div>';
                 F::redirect('/' . $pageinfos['cat'] . '/' . $pageinfos['page']);
             } else {
                 $pageContent = file_get_contents($path);
                 F::render('Doc/page-edit.html', array('page_edit_url' => $url_edit, 'page_view_url' => $url_view, 'page_title' => $pageTitle, 'page_content' => $pageContent, 'edition_mode' => true));
             }
         } else {
             F::render('Doc/page-view.html', array('page_edit_url' => $url_edit, 'page_title' => $pageTitle, 'page_content' => $pageContent, 'page_last_modif' => date('Y-m-d H:i:s', filemtime($path))));
         }
     } else {
         F::render('Core/404.html');
     }
 }
开发者ID:ray0be,项目名称:fastdoc,代码行数:43,代码来源:Doc.php

示例9: foreach

<?php 
if (Flight::has('data_partenaires')) {
    $data = Flight::get('data_partenaires');
    $c = 1;
    foreach ($data as $p) {
        if ($c % 2 == 0) {
            echo "<div class='content-section-a'>";
            $class1 = "col-lg-5 col-sm-6";
            $class2 = "col-lg-5 col-lg-offset-2 col-sm-6";
        } else {
            echo "<div class='content-section-b'>";
            $class1 = "col-lg-5 col-lg-offset-1 col-sm-push-6  col-sm-6";
            $class2 = "col-lg-5 col-sm-pull-6  col-sm-6";
        }
        echo "\n        <div class='container'>\n            <div class='row'>\n                <div class='{$class1}'>\n                    <hr class='section-heading-spacer'>\n                    <div class='clearfix'></div>\n                    <h2 class='section-heading'> {$p['0']} </h2>\n                    {$p['3']}\n                </div>\n                <div class='{$class2}'>\n                    <a href='{$p['2']}'> <img class='img-responsive' src='{$p['1']}' alt=''> </a>\n                </div>\n            </div>\n\n        </div>\n        <!-- /.container -->\n\n    </div>\n    <!-- /.content-section-a -->";
        $c = $c + 1;
    }
    // foreach
}
// if
开发者ID:Tijojo,项目名称:libre-en-fete-tregor,代码行数:20,代码来源:partenaires.php

示例10: Core_GUI

/**
 * Call GUI Builder
 */
$gui = new Core_GUI($module);
/**
 * Javascript Generator
 */
$js = new Core_GUI_JS($module);
/**
 * Build Page Header
 */
$gui->getHeader();
/**
 * Get Resource ID
 */
if (Flight::has('RESOURCE_ID')) {
    $resId = Flight::get('RESOURCE_ID');
    Flight::clear('RESOURCE_ID');
} else {
    // Bad Request
    Flight::redirect('/400');
}
// ===========================================================================================================
/**
 * Fetch Resource Model
 */
$dbh = Core_DBH::getDBH();
// Get Database Handle
$sth = $dbh->prepare("\n\tSELECT\n\t\tbox.box_id,\n\t\tos.operating_system,\n\t\tbox.name,\n\t\tbox.notes,\n\t\tbox.steam_lib_path\n\tFROM " . DB_PREFIX . "box AS box\n\tJOIN " . DB_PREFIX . "os AS os\n\t\tON box.os_id = os.os_id\n\tWHERE\n\t\tbox.box_id = :resId\n\t;");
$sth->bindParam(':resId', $resId);
$sth->execute();
开发者ID:master3395,项目名称:bgpanelv2,代码行数:31,代码来源:box.view.php

示例11: foreach

    $csshtml = '';
    if (Flight::has('csslib')) {
        foreach (Flight::get('csslib') as $value) {
            if (!strpos($value, '?')) {
                $csshtml .= "<link href=\"" . $value . "?v=" . Flight::get('VERSION') . "\" rel=\"stylesheet\" >\n";
            } else {
                $csshtml .= "<link href=\"" . $value . "&v=" . Flight::get('VERSION') . "\" rel=\"stylesheet\" >\n";
            }
        }
    }
    return $csshtml;
});
// 打印js
Flight::map('printjs', function () {
    $jshtml = '';
    if (Flight::has('jslib')) {
        foreach (Flight::get('jslib') as $value) {
            if (!strpos($value, '?')) {
                $jshtml .= "<script type='text/javascript' src=\"" . $value . "?v=" . Flight::get('VERSION') . "\"></script>\n";
            } else {
                $jshtml .= "<script type='text/javascript' src=\"" . $value . "&v=" . Flight::get('VERSION') . "\"></script>\n";
            }
        }
    }
    return $jshtml;
});
Flight::map('defaultassets', function ($tag = 1) {
    if ($tag == 1) {
        // css
        $html = '<link rel="stylesheet" href="/public/css/bootstrap.min.css" type="text/css" />
		    <link rel="stylesheet" href="/public/css/font-awesome.min.css" type="text/css" />
开发者ID:August2012,项目名称:Salary,代码行数:31,代码来源:view.php

示例12: function

		<?php 
echo Flight::get('region');
?>
, 
		<?php 
echo Flight::get('countryName');
?>
 - 
		Telephone Area Code: <?php 
echo Flight::get('areaCode');
?>
		<a class="right" target="_blank" href="http://geoplugin.com/">geoplugin.com</a>
	</div>
</div>
<?php 
if ($js && Flight::has('google_analytics_site_id')) {
    ?>
<script>
    (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
        function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
        e=o.createElement(i);r=o.getElementsByTagName(i)[0];
        e.src='//www.google-analytics.com/analytics.js';
        r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
    ga('create','<?php 
    echo Flight::get('google_analytics_site_id');
    ?>
');ga('send','pageview');
</script>

<?php 
}
开发者ID:spikedviper,项目名称:FlightGeoIP,代码行数:31,代码来源:default.php

示例13: switch

<?php

if ($geoinfo && $js) {
    switch ($maptype) {
        case 'here':
            $mapurl = "https://www.here.com/?map=" . Flight::get('latitude') . "," . Flight::get('longitude') . ",12,satellite";
            break;
        case 'google':
            if (Flight::has('google_embed_key')) {
                $mapurl = "https://www.google.com/maps/embed/v1/view?key=" . Flight::get('google_embed_key') . "&center=" . Flight::get('latitude') . "," . Flight::get('longitude') . "&zoom=12&maptype=satellite";
            } else {
                $mapurl = "http://wikimapia.org/#lang=en&lat=" . Flight::get('latitude') . "&lon=" . Flight::get('longitude') . "&z=12&m=b";
            }
            break;
        case 'wikimapia':
            $mapurl = "http://wikimapia.org/#lang=en&lat=" . Flight::get('latitude') . "&lon=" . Flight::get('longitude') . "&z=12&m=b";
            break;
        default:
            $mapurl = "https://www.google.com/maps/embed/v1/view?key=" . Flight::get('google_embed_key') . "&center=" . Flight::get('latitude') . "," . Flight::get('longitude') . "&zoom=12&maptype=satellite";
    }
    ?>

			<div id="mappane">
			<iframe id="map" src="<?php 
    echo $mapurl;
    ?>
" frameborder="0"></iframe>	
			</div>
<?php 
} elseif ($geoinfo) {
    ?>
开发者ID:spikedviper,项目名称:FlightGeoIP,代码行数:31,代码来源:iframe_insert.php

示例14:

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>
			<?php 
echo Flight::has('title') ? Flight::get('title') : 'Example';
?>
		</title>
	</head>
	<body>
开发者ID:marcker,项目名称:php-scaffold,代码行数:11,代码来源:head.php

示例15:

echo $user->bio;
?>
</p>
			<?php 
if (Flight::has('currentUser') && Flight::get("currentUser")->id == $user->id) {
    ?>
				<textarea id="bio-edit" style="display:none"></textarea>
				<button id="updateBio" type="button" class="btn btn-success">Update</button>
				<button id="saveBio" type="button" class="btn btn-success" style="display:none">Save</button>
				<button id="cancelBio" type="button" class="btn btn-danger" style="display:none">Cancel</button>
			<?php 
}
?>
        </div>
		<?php 
if (Flight::has('currentUser') && Flight::get("currentUser")->id == $user->id) {
    ?>
	        <div class="tab-pane fade in" id="tab3">
				  <div id="passwordalert" style="display:none" class="alert alert-danger" role="alert"></div>
		          <h3>Change Password:</h3>
				  <div class="input-group">
					  <span class="input-group-addon" id="label-oldpassword">Old Password</span>
					  <input type="password" class="form-control" id="passwordold" placeholder="Old Password" aria-describedby="label-oldpassword">
				  </div>
				  <br>
				  <div class="input-group">
					  <span class="input-group-addon" id="label-new1password">New Password</span>
					  <input type="password" class="form-control" id="passwordnew1" placeholder="New Password" aria-describedby="label-new1password">
				  </div>
				  <br>
				  <div class="input-group">
开发者ID:happyoniens,项目名称:Blog,代码行数:31,代码来源:profile.php


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