ldc-wenn-dann-mit-respekt/app/View/Components/ContentSnippet.php
2023-04-05 08:44:33 +00:00

63 lines
1.2 KiB
PHP

<?php
namespace App\View\Components;
use Illuminate\View\Component;
class ContentSnippet extends Component
{
/**
* snippet variable
*
* @var mixed
*/
private $snippet;
/**
* odd variable
*
* @var integer
*/
private $odd;
/**
* bgcolor variable
*
* @var mixed
*/
private $bgcolor;
/**
* Create a new component instance.
*
* @param mixed $snippet
* @param integer $odd
* @param mixed $bgcolor
* @return void
*/
public function __construct(mixed $snippet = null, int $odd = 0, mixed $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('fo.components.content-snippet', compact(['snippet', 'odd', 'bgcolor']));
}
}