PluginProbe
Depicter — Popup & Slider Builder / 1.5.2
Depicter — Popup & Slider Builder v1.5.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Html / Html.php

Html.php in Depicter — Popup & Slider Builder 1.5.2, at app/src/Html/Html.php

58 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Html;
3
4 use TypeRocket\Html\Html as TypeRocketHtml;
5
6 class Html extends TypeRocketHtml
7 {
8
9 /**
10 * Create new Tag
11 *
12 * @param string $tag
13 * @param array|string|null $attributes
14 * @param string|array|null $text
15 *
16 * @return TypeRocketHtml
17 */
18 protected function el($tag, $attributes = null, $text = null )
19 {
20 $this->tag = new Tag( $tag, $attributes, $text );
21
22 return $this;
23 }
24
25 /**
26 * Create new link
27 *
28 * @param string|array $text
29 * @param string $url
30 * @param array $attributes
31 *
32 * @return TypeRocketHtml
33 */
34 protected function a($text = '', $url = '#', array $attributes = [])
35 {
36 $attributes = array_merge( array_filter(['href' => $url], '\TypeRocket\Utility\Str::notBlank'), $attributes );
37 $this->tag = new Tag( 'a', $attributes, $text );
38
39 return $this;
40 }
41
42 /**
43 * Create new image
44 *
45 * @param string $src
46 * @param array $attributes
47 *
48 * @return $this
49 */
50 protected function img($src = '', array $attributes = [])
51 {
52 $attributes = array_merge( ['src' => $src], $attributes );
53 $this->tag = new Tag( 'img', $attributes );
54
55 return $this;
56 }
57 }
58