本文整理汇总了PHP中Control::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::error方法的具体用法?PHP Control::error怎么用?PHP Control::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::error方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error
/**
* 错误输出
* @param string $msg 提示内容
* @param string $url 跳转URL
* @param int $time 跳转时间
* @param null $tpl 模板文件
*/
protected function error($msg = '出错了', $url = NULL, $time = 2, $tpl = null)
{
if (IS_AJAX) {
$this->_ajax(0, $msg);
} else {
parent::error($msg, $url, $time, $tpl);
}
}
示例2: insert
public static function insert($vars)
{
if (is_array($vars)) {
$ins = array('table' => 'options', 'name' => $vars['name'], 'value' => $vars['value']);
$opt = Db::insert($ins);
} else {
Control::error('unknown', 'Format not Found, please in array');
}
return $opt;
}
示例3: theme
public static function theme($var, $data = '')
{
if (isset($data)) {
# code...
$GLOBALS['data'] = $data;
}
if (self::exist($var)) {
include GX_THEME . THEME . '/' . $var . '.php';
} else {
Control::error('unknown', 'Theme file is missing.');
}
}
示例4: admin
/**
* GxMain Admin Function.
* This will load the backend controller. Secured, so to access it must be
* logged in with a current privilege. Default privilege is 2.
*
* @author Puguh Wijayanto (www.metalgenix.com)
* @since 0.0.1
*/
public function admin()
{
Session::start();
User::secure();
System::gZip();
if (User::access(2)) {
Control::handler('backend');
} else {
Theme::admin('header');
Control::error('noaccess');
Theme::admin('footer');
}
System::Zipped();
}
示例5: extract
$Planche->setClient($client);
socket_getpeername($client, $sClientIp, $nClientPort);
$sRequestHeader = socket_read($client, 1024);
$GET = http_parse_headers($sRequestHeader, 'GET');
$POST = http_parse_headers($sRequestHeader, 'POST');
$REQUEST = array_merge($GET, $POST);
if ($REQUEST['URL'] == '/favicon.ico') {
socket_close($client);
continue;
}
if (@$REQUEST['PARAMS']['callback']) {
//echo "JSON Callback : ".$REQUEST['PARAMS']['callback']."\n";
$Planche->setCallback($REQUEST['PARAMS']['callback']);
}
if (isset($REQUEST['PARAMS']) === false) {
$Planche->error('Invalid request');
socket_close($client);
continue;
}
if (isset($REQUEST['PARAMS']['cmd']) === false) {
$Planche->error('Invalid request');
socket_close($client);
continue;
}
extract(json_decode(base64_decode($REQUEST['PARAMS']['cmd']), true));
echo "Execute Query\n";
echo "Connect {$host}, {$user}, **************, {$db}\n";
if ($Planche->connect($host, $user, $pass, $db)) {
echo "Connection Successful\n";
echo "The execution SQL is\n";
print_r($query);
示例6: query
/**
* Database Query Function.
* This will proccess database query.
*
* @param string $vars
*
* @author Puguh Wijayanto (www.metalgenix.com)
* @since 0.0.1
*/
public static function query($vars)
{
if (DB_DRIVER == 'mysql') {
mysql_query('SET CHARACTER SET utf8');
$q = mysql_query($vars) or die(mysql_error());
} elseif (DB_DRIVER == 'mysqli') {
self::$mysqli->set_charset("utf8");
$q = self::$mysqli->query($vars);
if ($q === false) {
Control::error('db', "Query failed: " . self::$mysqli->error . "<br />\n");
}
}
return $q;
}
示例7: foreach
</a> on <?php
echo Date::local($data['posts'][0]->date);
?>
</span>
</div>
</div>
</div>
</div>
</header>
<!-- Post Content -->
<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<?php
if (isset($data['posts'][0]->title)) {
foreach ($data['posts'] as $p) {
# code...
echo "\n <div class=\"\">\n " . Posts::content($p->content) . "\n </div>\n <hr />\n <div class=\"col-sm-12\">\n <div class=\"row\">\n <h3>Comments</h3>\n <div class=\"fb-comments\" data-href=\"http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\" data-width=\"100%\" data-numposts=\"5\" data-colorscheme=\"light\"></div>\n </div>\n </div>\n ";
}
} else {
//echo "Error, Post not found.";
Control::error('404');
}
?>
</div>
</div>
</div>
</article>