本文整理汇总了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);
}