PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 134 releases
jetformbuilder / modules / framework / blocks-style-manager / path-url-trait.php

path-url-trait.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at modules/framework/blocks-style-manager/path-url-trait.php

79 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Crocoblock\Blocks_Style;
3
4 /**
5 * Path and URL trait
6 *
7 * @since 1.0.0
8 */
9 trait Path_Url_Trait {
10
11 /**
12 * Module directory path.
13 *
14 * @since 1.0.0
15 * @access protected
16 * @var srting.
17 */
18 protected $path;
19
20 /**
21 * Module directory URL.
22 *
23 * @since 1.0.0
24 * @access protected
25 * @var srting.
26 */
27 protected $url;
28
29 /**
30 * Set module directory path
31 *
32 * @param string $path Path.
33 * @return self
34 */
35 public function set_path( $path ) {
36 $this->path = $path;
37 return $this;
38 }
39
40 /**
41 * Get module directory path to file
42 *
43 * @param string $file File name.
44 * @return string
45 */
46 public function get_path( string $file = '' ) {
47 if ( ! $this->path ) {
48 $this->path = trailingslashit( plugin_dir_path( __FILE__ ) );
49 }
50
51 return $this->path . $file;
52 }
53
54 /**
55 * Set module directory URL
56 *
57 * @param string $url URL.
58 * @return self
59 */
60 public function set_url( $url ) {
61 $this->url = $url;
62 return $this;
63 }
64
65 /**
66 * Get module directory URL to file
67 *
68 * @param string $file File name.
69 * @return string
70 */
71 public function get_url( string $file = '' ) {
72 if ( ! $this->url ) {
73 $this->url = trailingslashit( plugin_dir_url( __FILE__ ) );
74 }
75
76 return $this->url . $file;
77 }
78 }
79