ldc-wenn-dann-mit-respekt/app/View/Components/ContentPart.php
Vincent BRIDIER 2aa73fa32c Clean + CI/CD
2022-12-23 17:24:09 +00:00

63 lines
1.2 KiB
PHP

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