當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utilities::FindKey方法代碼示例

本文整理匯總了PHP中Utilities::FindKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utilities::FindKey方法的具體用法?PHP Utilities::FindKey怎麽用?PHP Utilities::FindKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Utilities的用法示例。


在下文中一共展示了Utilities::FindKey方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct($message, $type)
 {
     $bootstrap = false;
     if (!empty(Utilities::FindKey('BootstrapMessages', $GLOBALS['Config']))) {
         $bootstrap = Utilities::FindKey('BootstrapMessages', $GLOBALS['Config']);
     }
     switch (strtoupper($type)) {
         default:
         case 'ERR':
         case 'ERROR':
             $style = 'danger';
             break;
         case 'SUCC':
         case 'SUCCESS':
             $style = 'success';
             break;
         case 'WARN':
         case 'WARNING':
             $style = 'warning';
             break;
         case 'INFO':
         case 'INFORMATION':
             $style = 'info';
             break;
     }
     if ($bootstrap === true) {
         $message = '<p class="alert alert-' . $style . '" role="alert">' . $message . '</p>';
     }
     echo $message;
 }
開發者ID:Nozemi,項目名稱:MyFramework,代碼行數:30,代碼來源:MessageHandler.class.php

示例2: runQuery

 private static function runQuery($query, $params = null, $db)
 {
     try {
         $stmt = $db->prepare($query);
         $result = $stmt->execute($params);
         return array('Result' => $stmt, 'Success' => true);
     } catch (PDOException $ex) {
         if (Utilities::FindKey('Debug', $GLOBALS['Config']) === true) {
             $message = 'Error Message: ' . $ex->getMessage();
         } else {
             $message = 'Something went wrong while running the query. Please report to an administrator as soon as possible.';
         }
         return array('Result' => $message, 'Success' => false);
     }
 }
開發者ID:Nozemi,項目名稱:MyFramework,代碼行數:15,代碼來源:SQL.class.php

示例3:

	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

	<!-- Latest compiled and minified JavaScript -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-lg-2"></div>
			<div class="col-lg-8">
				<div class="page-header">
				  <h1><?php 
echo Utilities::FindKey('SiteTitle', $Config);
?>
 <small>Documentation</small></h1>
				</div>
				<nav class="navbar navbar-default">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nozframework-navbar-collapse" aria-expanded="false">
							<span class="sr-only">Toggle navigation</span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>
					</div>
					<div class="collapse navbar-collapse" id="nozframework-navbar-collapse">
						<ul class="nav navbar-nav navbar-left">
							<li><a href="#">Getting Started</a></li>
開發者ID:Nozemi,項目名稱:MyFramework,代碼行數:30,代碼來源:index.php


注:本文中的Utilities::FindKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。