Path.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Type\Url; |
| 4 | |
| 5 | trait Path { |
| 6 | |
| 7 | /** |
| 8 | * @var string |
| 9 | */ |
| 10 | protected $path; |
| 11 | |
| 12 | /** |
| 13 | * @param string $path |
| 14 | */ |
| 15 | protected function set_path( $path ) { |
| 16 | $this->path = '/' . trim( $path, '/' ) . '/'; |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * @return string |
| 21 | */ |
| 22 | protected function get_path() { |
| 23 | return $this->path; |
| 24 | } |
| 25 | |
| 26 | } |