本文整理汇总了PHP中Debug::r方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::r方法的具体用法?PHP Debug::r怎么用?PHP Debug::r使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::r方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dologinAction
public function dologinAction()
{
Db::connect();
$bean = R::dispense('user');
// the redbean model
$required = ['Name' => 'name', 'Email' => 'email', 'User_Name' => ['rmnl', 'az_lower'], 'Password' => 'password_hash'];
\RedBeanFVM\RedBeanFVM::registerAutoloader();
// for future use
$fvm = \RedBeanFVM\RedBeanFVM::getInstance();
$fvm->generate_model($bean, $required);
//the magic
R::store($bean);
$val = new validation();
$val->addSource($_POST)->addRule('email', 'email', true, 1, 255, true)->addRule('password', 'string', true, 10, 150, false);
$val->run();
if (count($val->errors)) {
Debug::r($val->errors);
foreach ($val->errors as $error) {
Notification::setMessage($error, Notification::TYPE_ERROR);
}
$this->redirect(Request::createUrl('login', 'login'));
} else {
Notification::setMessage("Welcome back !", Notification::TYPE_SUCCESS);
Debug::r($val->sanitized);
session::set('user', ['sanil']);
$this->redirect(Request::createUrl('index', 'index'));
}
}
示例2: run
/**
* Run the application
* @param type $appBasePath
*/
public function run($appBasePath)
{
/**
* Define application base path
*/
defined('APP_BASE_PATH') or define('APP_BASE_PATH', $appBasePath);
/**
* get controller and action from from url
*/
$controller = Request::getController();
$action = Request::getAction();
/**
* prepare controller class and path according to convention
*/
$controllerClass = $controller . 'Controller';
$controllerPath = APP_BASE_PATH . '/controllers/' . $controllerClass . '.php';
/**
* check if requested controller file and class exists
* @todo use error controller and action to display errors
*/
if (file_exists($controllerPath)) {
/**
* Include requested controller
*/
include_once $controllerPath;
if (class_exists($controllerClass)) {
$Controller = new $controllerClass();
} else {
$msg = $controllerClass . ' class not found!';
exit($msg);
}
} else {
$msg = $controllerPath . ' not found!';
exit($msg);
}
/**
* prepare method
*/
$methodName = $action . 'Action';
if (!method_exists($Controller, $methodName)) {
$msg = " Method {$methodName} not found on {$controllerClass} Class ";
exit($msg);
}
/**
* execute appropriate contoller's action method
*/
try {
$Controller->{$methodName}();
} catch (Exception $exc) {
Debug::r($exc->getMessage(), 'application-exception.txt');
}
}
示例4:
<?php
Debug::r($this->data);
echo Request::getBaseUrl(true);
示例5: DBTable
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<style>
.wrapper{
width: 768px;
margin: 50px auto;
}
</style>
</head>
<body>
<div class="wrapper">
<h1>Database Analyse</h1>
<section>
<h2>Basic Info</h2>
<h3>Database</h3>
<?php
echo Debug::r($database);
?>
<h3>Tables</h3>
<?php
echo $table->listing($tables);
?>
<h3>Columns</h3>
<?php
foreach ($tables as $name) {
echo "<h4>{$name}</h4>";
$cols = $dbh->columns($name);
echo $table->multi($cols);
$tableInfo[$name] = new DBTable($name, $cols);
}
?>
</section>