widgets, fontawesome add
This commit is contained in:
35
app/Widgets/ActionButtonWidget.php
Normal file
35
app/Widgets/ActionButtonWidget.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Widgets;
|
||||
|
||||
use Arrilot\Widgets\AbstractWidget;
|
||||
use itguild\forms\debug\Debug;
|
||||
|
||||
class ActionButtonWidget extends AbstractWidget
|
||||
{
|
||||
/**
|
||||
* The configuration array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $config = [];
|
||||
|
||||
/**
|
||||
* Treat this method as a controller action.
|
||||
* Return view() or other content to display.
|
||||
*/
|
||||
public function run(): \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application
|
||||
{
|
||||
$label = $this->config['label'];
|
||||
$btn_type = $this->config['btn_type'];
|
||||
$url = $this->config['url'];
|
||||
$title = $this->config['title'] ?? '';
|
||||
|
||||
return view('widgets.action_button_widget', [
|
||||
'label' => $label,
|
||||
'btn_type' => $btn_type,
|
||||
'url' => $url,
|
||||
'title' => $title
|
||||
]);
|
||||
}
|
||||
}
|
33
app/Widgets/IconBtnCreateWidget.php
Normal file
33
app/Widgets/IconBtnCreateWidget.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Widgets;
|
||||
|
||||
use Arrilot\Widgets\AbstractWidget;
|
||||
|
||||
class IconBtnCreateWidget extends AbstractWidget
|
||||
{
|
||||
/**
|
||||
* The configuration array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $config = [];
|
||||
|
||||
/**
|
||||
* Treat this method as a controller action.
|
||||
* Return view() or other content to display.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$url = $this->config['url'];
|
||||
|
||||
$btn = new ActionButtonWidget([
|
||||
// 'label' => "<i class='fa-regular fa-square-plus'></i>",
|
||||
'label' => "Создать",
|
||||
'url' => $url,
|
||||
'btn_type' => "success",
|
||||
'title' => "Создать"
|
||||
]);
|
||||
$btn->run();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user