action btn
This commit is contained in:
		| @@ -18,7 +18,8 @@ class ActionButtonWidget extends Widget | ||||
|         $label = $this->data['label']; | ||||
|         $btn_type = $this->data['btn_type']; | ||||
|         $url = $this->data['url']; | ||||
|         $title = $this->data['title'] ?? ''; | ||||
|  | ||||
|         return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url]); | ||||
|         return $this->cgView->fetch('/action_button.php', ['label' => $label, 'btn_type' => $btn_type, 'url' => $url, 'title' => $title]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										27
									
								
								kernel/widgets/IconBtn/IconBtnViewWidget.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								kernel/widgets/IconBtn/IconBtnViewWidget.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| <?php | ||||
|  | ||||
| namespace kernel\widgets\IconBtn; | ||||
|  | ||||
| use kernel\Widget; | ||||
| use kernel\widgets\ActionButtonWidget; | ||||
|  | ||||
| class IconBtnViewWidget extends Widget | ||||
| { | ||||
|     public static function create(array $data = []): IconBtnViewWidget | ||||
|     { | ||||
|         return new static($data); | ||||
|     } | ||||
|  | ||||
|     public function run(): string | ||||
|     { | ||||
|         $url = $this->data['url']; | ||||
|  | ||||
|         return ActionButtonWidget::create([ | ||||
|             'btn_type' => "primary", | ||||
|             'label' => "<i class='fa-regular fa-eye'></i>", | ||||
|             'url' => $url, | ||||
|             'title' => "Просмотреть" | ||||
|         ])->run(); | ||||
|     } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user