ldc-nature-and-respect/app/View/Components/ContentPart.php

64 lines
1.2 KiB
PHP
Raw Normal View History

2022-11-18 12:39:03 +01:00
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class ContentPart extends Component
{
2022-12-23 17:24:09 +00:00
/**
* Part variable
*
* @var mixed
*/
2022-11-18 12:39:03 +01:00
private $part;
2022-11-18 15:35:39 +01:00
2022-12-23 17:24:09 +00:00
/**
* odd variable
*
* @var integer
*/
2022-11-18 12:39:03 +01:00
private $odd;
2022-11-18 15:35:39 +01:00
2022-12-23 17:24:09 +00:00
/**
* bgcolor variable
*
* @var mixed
*/
2022-11-18 12:39:03 +01:00
private $bgcolor;
/**
* Create a new component instance.
*
2022-12-23 17:24:09 +00:00
* @param mixed $part
* @param integer $odd
* @param mixed $bgcolor
2022-11-18 12:39:03 +01:00
* @return void
*/
2022-12-23 17:24:09 +00:00
public function __construct(mixed $part = null, int $odd = 0, mixed $bgcolor = null)
2022-11-18 12:39:03 +01:00
{
$this->part = null;
2022-11-18 15:35:39 +01:00
if ($part != null) {
$this->part = $part;
}
2022-11-18 12:39:03 +01:00
$this->odd = $odd;
2022-11-18 15:35:39 +01:00
if ($bgcolor != null) {
$this->bgcolor = $bgcolor;
}
2022-11-18 12:39:03 +01:00
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
2022-11-18 15:35:39 +01:00
$part = $this->part;
$odd = $this->odd;
2022-11-18 12:39:03 +01:00
$bgcolor = $this->bgcolor;
return view('components.content-part', compact(['part', 'odd', 'bgcolor']));
}
}