| 1 | <?php |
||
| 13 | class Page extends Node { |
||
| 14 | |||
| 15 | 11 | function __construct(Driver $driver = NULL, $extension = NULL) |
|
|
|
|||
| 16 | { |
||
| 17 | 11 | $this->_driver = $driver ?: new Driver_Simple; |
|
| 18 | |||
| 19 | 11 | if ($extension) |
|
| 20 | { |
||
| 21 | 1 | $this->_extension = $extension; |
|
| 22 | } |
||
| 23 | 11 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Initiate a visit with the currently selected driver |
||
| 27 | * @param string $uri |
||
| 28 | * @param array $query |
||
| 29 | * @return $this |
||
| 30 | */ |
||
| 31 | 1 | public function visit($uri, array $query = array()) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Return the content of the last request from the currently selected driver |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | 1 | public function content() |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Return the current browser url without the domain |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 1 | public function current_path() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Return the current url |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | 1 | public function current_url() |
|
| 64 | } |
||
| 65 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.