本文整理汇总了PHP中yii\helpers\VarDumper::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP VarDumper::dump方法的具体用法?PHP VarDumper::dump怎么用?PHP VarDumper::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\VarDumper
的用法示例。
在下文中一共展示了VarDumper::dump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: myVarDump
function myVarDump($param)
{
echo '<pre>';
\yii\helpers\VarDumper::dump($param);
echo '</pre>';
die;
}
示例2: dump
/**
* @inheritdoc
*/
public static function dump($var, $exit = 1, $depth = 10, $highlight = true)
{
parent::dump($var, $depth, $highlight);
if ($exit) {
exit;
}
}
示例3: actionCookie
public function actionCookie()
{
// Yii::$app->response->format = Response::FORMAT_RAW;
// $headers = Yii::$app->response->headers;
// $headers->add('Content-type', 'image/gif');
// $headers->add('Content-Length', '42');
// $headers->add('Cache-Control', 'private, no-cache, no-cache=Set-Cookie, proxy-revalidate');
// $headers->add('Expires', 'Wed, 11 Jan 2000 12:59:00 GMT');
// $headers->add('Last-Modified', 'Wed, 11 Jan 2006 12:59:00 GMT');
// $headers->add('Pragma', 'no-cache');
// echo sprintf('%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%', 71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 255, 0, 192, 192, 192, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59);
$clientCookie = new ClientCookie();
if ($clientCookie->cookie_id === null) {
$cookie = new Cookie();
$cookie->last_activity = $cookie->create_time = date('Y-m-d H:i:s');
$cookie->save();
$clientCookie->cookie_id = $cookie->id;
} else {
$cookie = Cookie::findOne(['id' => $clientCookie->cookie_id]);
if ($cookie !== null) {
$cookie->last_activity = date('Y-m-d H:i:s');
$cookie->save();
}
}
// $clientCookie->updateCategory(3, [
// 'value' => 1
// ]);
$clientCookie->save();
echo "<pre>";
VarDumper::dump($clientCookie);
echo "</pre>";
}
示例4: testDumpObject
public function testDumpObject()
{
$obj = new \StdClass();
ob_start();
VarDumper::dump($obj);
$this->assertEquals("stdClass#1\n(\n)", ob_get_contents());
ob_end_clean();
}
示例5: resetPassword
/**
* Resets password.
*
* @return boolean if password was reset.
*/
public function resetPassword()
{
$user = $this->_user;
VarDumper::dump($user);
$user->setPassword($this->password);
$user->removePasswordResetToken();
return $user->save(false);
}
示例6: yii
public function yii($v, $stop = false, $depth = 100)
{
echo '<pre style="' . $this->getStyle() . '">';
YiiVarDumper::dump($v, $depth, true);
echo '</pre>';
if ($stop) {
exit;
}
}
示例7: D
function D($object, $exit = false)
{
VarDumper::dump($object, 20, 1);
echo '<br />';
if ($exit) {
exit;
}
return null;
}
示例8: kepco_suc_detail
public function kepco_suc_detail($job)
{
echo $job->workload(), PHP_EOL;
$workload = Json::decode($job->workload());
$httpClient = new \GuzzleHttp\Client(['base_uri' => 'http://203.248.44.161', 'cookies' => true, 'headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko', 'Content-Type' => 'application/json', 'X-Requested-With' => 'XMLHttpRequest', 'Accept-Language' => 'ko', 'Accept-Encoding' => 'gzip, deflate', 'DNT' => '1', 'Pragma' => 'no-cache', 'Connection' => 'Keep-Alive', 'Accept' => '*/*', 'Referer' => 'http://203.248.44.161/mdi.do?theme=default', 'X-CSRF-TOKEN' => $this->csrf_token, 'Cookie' => $this->cookie]]);
$response = $httpClient->request('POST', '/router', ['json' => [['action' => 'smartsuit.ui.etnajs.pro.rfx.sp.OpenInfoDataDetailController', 'method' => 'findOpenInfoDataAttendGrid', 'tid' => 118, 'type' => 'rpc', 'data' => [$workload['id']]], ['action' => 'smartsuit.ui.etnajs.pro.rfx.sp.OpenInfoDataDetailController', 'method' => 'findProposalEvalOpenYn', 'tid' => 119, 'type' => 'rpc', 'data' => [$workload['id']]]]]);
$body = $response->getBody();
$json = Json::decode($body);
VarDumper::dump($json);
}
示例9: d
/**
* Debug function
* d($var);
* @param $var
* @param null $caller
*/
function d($var, $caller = null)
{
if (!isset($caller)) {
$tmp_var = debug_backtrace(1);
$caller = array_shift($tmp_var);
}
echo '<code>File: ' . $caller['file'] . ' / Line: ' . $caller['line'] . '</code>';
echo '<pre>';
VarDumper::dump($var, 10, true);
echo '</pre>';
}
示例10: dd
/**
* Dump and die - Dump as many variables as you want. Infinite parameters.
*/
function dd()
{
$args = func_get_args();
foreach ($args as $k => $arg) {
echo '<fieldset class="debug">
<legend>' . ($k + 1) . '</legend>';
VarDumper::dump($arg, 10, true);
echo '</fieldset>';
}
die;
}
示例11: dump
/**
* var_dump() wrapper with autoexit
*
* @param $var
* @param bool $isExit
* @param bool $asString
* @param int $depth
* @return string
*/
public static function dump($var, $isExit = true, $asString = false, $depth = 3)
{
if ($asString) {
return VarDumper::dumpAsString($var, $depth, true);
} else {
VarDumper::dump($var, $depth, true);
}
if ($isExit) {
exit;
}
}
示例12: actionAddExam
public function actionAddExam()
{
$model = new \common\models\ExamForm();
if ($model->load(\Yii::$app->request->post()) && $model->validate()) {
\yii\helpers\VarDumper::dump(\Yii::$app->request->post(), 10, true);
die;
$model->addExam();
\Yii::$app->session->setFlash('success', 'Exam Added Successfully');
return $this->redirect(['/exam']);
}
return $this->render('add-exam', ['model' => $model]);
}
示例13: actionTimeouts
/**
* Manage the timeouts of the StateMachines
*/
public function actionTimeouts()
{
/** @var SmTimeout[] $timeouts */
$timeouts = SmTimeout::find()->andWhere(['<=', 'expires_at', new Expression('NOW()')])->all();
foreach ($timeouts as $timeout) {
$context = $timeout->transition();
if ($context->hasException()) {
// Handle timeout transition failure
VarDumper::dump($context->getFirstException(), 10);
}
}
}
示例14: actionCommit
public function actionCommit()
{
if ($transaction = Transaction::getFromSession()) {
\yii\helpers\VarDumper::dump($transaction, 11, 1);
$transaction->setOrgId($this->organization->id);
if ($transaction->commit()) {
return $this->render('transaction_success', []);
} else {
return $this->render('transaction_error', []);
}
}
return $this->redirect('/transactions');
}
示例15: dump
/**
* 打印输出
* @param type $var
* @param type $depth
* @param type $highlight
* @param type $isDie
*/
public static function dump($var, $depth = 10, $highlight = true, $isDie = true)
{
if ($highlight) {
parent::dump($var, $depth, $highlight);
} else {
echo '<pre>';
parent::dump($var, $depth, $highlight);
echo '</pre>';
}
if ($isDie === true) {
die;
}
}