本文整理匯總了PHP中Illuminate\Support\MessageBag::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP MessageBag::__construct方法的具體用法?PHP MessageBag::__construct怎麽用?PHP MessageBag::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Support\MessageBag
的用法示例。
在下文中一共展示了MessageBag::__construct方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Create a new message bag instance.
*
* @param array $messages
* @return void
*/
public function __construct(array $messages = array(), array $levels = null)
{
parent::__construct($messages);
if ($levels) {
$this->levels = $levels;
}
}
示例2: __construct
public function __construct($messages = array())
{
if (is_string($messages)) {
$messages = (array) $messages;
}
parent::__construct($messages);
}
示例3: __construct
public function __construct(Store $session, $messages = array())
{
$this->session = $session;
if ($session->has($this->session_key)) {
$messages = array_merge_recursive($session->get($this->session_key), $messages);
}
parent::__construct($messages);
}
示例4: __construct
public function __construct(array $messages = array())
{
parent::__construct($messages);
$this->session = App::make('session');
if ($this->session->has(self::SESSION_KEY)) {
$this->messages = $this->session->get(self::SESSION_KEY);
}
$this->purge();
}
示例5: __construct
public function __construct($messages = array())
{
if ($messages instanceof \Exception) {
$messages = $messages->getMessage() . ' on file ' . $messages->getFile() . ' line (' . $messages->getLine() . ')';
}
if (is_string($messages)) {
$messages = (array) $messages;
}
parent::__construct($messages);
}
示例6: __construct
public function __construct(array $messages = array())
{
parent::__construct($messages);
$this->flashMessages = Session::get(Config::get('msg::session_key') . '.messages', array());
$this->flashOptions = Session::get(Config::get('msg::session_key') . '.options', array());
$this->setFormat(Config::get('msg::format'));
$this->setTemplate(Config::get('msg::template'));
$this->setDisplayMode(Config::get('msg::display_mode'));
$sortMessages = Config::get('msg::sort_messages');
$this->setSortMessages($sortMessages[0], $sortMessages[1]);
}
示例7: __construct
/**
* @param \Illuminate\Session\Store $session
* @param \Illuminate\Config\Repository $config
* @param array $messages
* @return \Prologue\Alerts\AlertsMessageBag
*/
public function __construct(Session $session, Config $config, array $messages = [])
{
$this->config = $config;
$this->session = $session;
// If there are already messages stored in the current
// session, merge them with the provided messages.
if ($session->has($this->getSessionKey())) {
$messages = array_merge_recursive($session->get($this->getSessionKey()), $messages);
}
parent::__construct($messages);
}
示例8: __construct
/**
* Create new instance.
*
* @param string $headingKey
* @param array $messages
* @return void
*/
public function __construct($headingKey = 'heading', array $messages = array())
{
$this->headingKey = $headingKey;
$messages = $this->extractHeading($messages);
parent::__construct($messages);
}