本文整理汇总了PHP中Flash::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::getInstance方法的具体用法?PHP Flash::getInstance怎么用?PHP Flash::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($action, $submit_value, $method, $sticky, $message_type, $format, $multiple_errors)
{
$this->fields = new stdClass();
$this->action = $action;
$this->method = $method;
$this->submit_value = $submit_value;
$this->sticky = $sticky;
$this->format = $format;
$this->message_type = $message_type;
$this->multiple_errors = $multiple_errors;
if ($message_type == 'flash') {
$this->flash = Flash::getInstance();
}
if ($message_type == 'list') {
$this->messages = array();
}
}
示例2: __construct
public function __construct($render = false)
{
$this->render = $render;
$this->flash = Flash::getInstance();
}
示例3: error_reporting
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
session_name('nibble');
ini_set('session.gc_maxlifetime', 30 * 60);
session_set_cookie_params(30 * 60);
session_start();
include dirname(__FILE__) . '/nibble-flash-messaging/Flash.class.php';
$flash = Flash::getInstance();
$flash->message('Simple message example');
$flash->flashMessage('Message content goes here, 5s lifetime', 'Message title goes here', 5000);
$flash->message('Sticky error message', 'Sticky message', 0, true, 'error');
include dirname(__FILE__) . '/nibble-forms/NibbleForm.class.php';
$form = NibbleForm::getInstance('', 'Submit this form', 'post', true, 'flash');
$form->username = new Text('Please enter your username', true, 20, '/[a-zA-Z0-9]+/');
$form->email = new Email('Please enter your email', false);
$form->email->addConfirmation('Please confirm your email');
$form->captcha = new Captcha();
/*$form->password = new Password('Please enter your password', 11, true, true, 12);
$form->password->addConfirmation('Please confirm your password');
$form->checkbox = new Checkbox('Please select one of the following', array(
'One' => 'Choice one, dont choose',
'car' => 'Choice two',
'Choice three',
'Choice four'
),true,2);
$form->select = new MultipleSelect('Please select at least two of the following', array(
'One'=>'Choice one',
'Choice two',
'Choice three'
示例4: flash
/**
* @desc Render flash messages
*/
public function flash()
{
foreach (Flash::getInstance()->messages as $message) {
echo $message;
}
}