本文整理汇总了PHP中Messages::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::all方法的具体用法?PHP Messages::all怎么用?PHP Messages::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMessagesRespectFormat
/**
* Test the Messages::get method.
*
* @group laravel
*/
public function testMessagesRespectFormat()
{
$this->messages->add('email', 'test');
$this->assertEquals('<p>test</p>', $this->messages->first('email', '<p>:message</p>'));
$this->assertEquals(array('<p>test</p>'), $this->messages->get('email', '<p>:message</p>'));
$this->assertEquals(array('<p>test</p>'), $this->messages->all('<p>:message</p>'));
}
示例2: testMessagesRespectFormat
/**
* Test the Messages::first method.
* Test the Messages::get method.
* Test the Messages::all method.
*
* @group laravel
*/
public function testMessagesRespectFormat()
{
$this->messages->add_typed('ok', 'success');
$this->assertEquals(new Entry('<p class="success">ok</p>', 'success'), $this->messages->first(null, '<p class=":type">:message</p>'));
$this->assertEquals(new Entry('<p class="success">ok</p>', 'success'), $this->messages->first('success', '<p class=":type">:message</p>'));
$this->assertEquals(array(new Entry('<p class="success">ok</p>', 'success')), $this->messages->get('success', '<p class=":type">:message</p>'));
$this->assertEquals(array(new Entry('<p class="success">ok</p>', 'success')), $this->messages->all('<p class=":type">:message</p>'));
}
示例3: render
function render()
{
$message = new Messages($this->db);
$message->key = 'Second message';
$message->message = 'This is the second message inserted from code';
$message->save();
$messages = new Messages($this->db);
$msg = $messages->all()[0];
$this->f3->set('msg', $msg);
$template = new Template();
echo $template->render('template.htm');
}