ldc-nature-and-respect/app/View/Components/ContentSnippet.php
2022-11-18 12:39:03 +01:00

39 lines
903 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']));
}
}