April 21, 2018 —John Koster
The getFormat
is the logical opposite of the setFormat
method. It simply returns the current format that is being used by the MessageBag
instance.
The signature of the getFormat
method is:
1public function getFormat();
The following examples demonstrate the usage of the getFormat
method:
1use Illuminate\Support\MessageBag; 2 3// Create a new MessageBag instance. 4$messageBag = new MessageBag; 5 6// :message 7$format = $messageBag->getFormat(); 8 9// Change the format.10$messageBag->setFormat('<li>:message</li>');11 12// <li>:message</li>13$format = $messageBag->getFormat();14 15// Reset the format.16$messageBag->setFormat();17 18// :message19$format = $messageBag->getFormat();
∎