Debian Codegraph @

vendor/ipl/web/src/Widget/ActionLink.php

raw
1 <?php
2
3 namespace ipl\Web\Widget;
4
5 use ipl\Html\Attributes;
6 use ipl\Web\Url;
7
8 /**
9 * Link generally pointing to CRUD actions
10 */
11 class ActionLink extends Link
12 {
13 protected $defaultAttributes = ['class' => 'action-link'];
14
15 /**
16 * Create a action link
17 *
18 * @param mixed $content
19 * @param Url|string $url
20 * @param string $icon
21 * @param Attributes|array $attributes
22 */
23 public function __construct($content, $url, $icon = null, $attributes = null)
24 {
25 parent::__construct($content, $url, $attributes);
26
27 if ($icon !== null) {
28 $this->prepend(new Icon($icon));
29 }
30 }
31 }