blessing-skin-server/app/Events/RenderingFooter.php
2017-01-20 18:22:10 +08:00

31 lines
570 B
PHP

<?php
namespace App\Events;
class RenderingFooter extends Event
{
protected $contents;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(array &$contents)
{
// pass array by reference
$this->contents = &$contents;
}
public function addContent($content)
{
if ($content) {
if (!is_string($content)) {
throw new \Exception("Can not add non-string content", 1);
}
$this->contents[] = $content;
}
}
}