1 | <?php |
||
14 | class View { |
||
15 | |||
16 | /** |
||
17 | * Views folder. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | public static $folder = 'views'; |
||
22 | |||
23 | /** |
||
24 | * Returns view name to show based on request value. |
||
25 | * |
||
26 | * @return string |
||
27 | */ |
||
28 | public static function get_view() { |
||
39 | |||
40 | /** |
||
41 | * Replaces all slashes with dots. |
||
42 | * |
||
43 | * @param string $view View's name. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public static function get_blade_view( $view ) { |
||
52 | |||
53 | /** |
||
54 | * Returns list of theme page templates. |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public static function get_page_templates_list() { |
||
84 | } |
||
85 |
This check looks for type mismatches where the missing type is
false
. This is usually indicative of an error condtion.Consider the follow example
This function either returns a new
DateTime
object or false, if there was an error. This is a typical pattern in PHP programming to show that an error has occurred without raising an exception. The calling code should check for this returnedfalse
before passing on the value to another function or method that may not be able to handle afalse
.