ldc-nature-and-respect/app/View/Components/ContentSnippet.php
Vincent BRIDIER 9cd503affd
PHPCBF
2022-11-18 15:35:39 +01:00

44 lines
951 B
PHP

<?php
namespace App\View\Components;
use Illuminate\View\Component;
class ContentSnippet extends Component
{
private $snippet;
private $odd;
private $bgcolor;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct($snippet = null, $odd = 0, $bgcolor = null)
{
$this->snippet = null;
if ($snippet != null) {
$this->snippet = $snippet;
}
$this->odd = $odd;
if ($bgcolor != null) {
$this->bgcolor = $bgcolor;
}
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
$snippet = $this->snippet;
$odd = $this->odd;
$bgcolor = $this->bgcolor;
return view('components.content-snippet', compact(['snippet', 'odd', 'bgcolor']));
}
}