@@ -7,38 +7,38 @@ |
||
7 | 7 | * @license http://kohanaframework.org/license |
8 | 8 | */ |
9 | 9 | return [ |
10 | - 'kohanaview' => [ |
|
11 | - 'renderer' => [ |
|
12 | - 'html' => [ |
|
13 | - '_settings' => [ |
|
14 | - 'class' => '\Ingenerator\KohanaView\Renderer\HTMLRenderer', |
|
15 | - 'arguments' => ['%kohanaview.template.selector%', '%kohanaview.template.manager%'], |
|
16 | - 'shared' => TRUE, |
|
17 | - ], |
|
18 | - ], |
|
19 | - ], |
|
20 | - 'template' => [ |
|
21 | - 'compiler' => [ |
|
22 | - '_settings' => [ |
|
23 | - 'class' => '\Ingenerator\KohanaView\TemplateCompiler', |
|
24 | - 'arguments' => [], |
|
25 | - 'shared' => TRUE, |
|
26 | - ], |
|
27 | - ], |
|
28 | - 'manager' => [ |
|
29 | - '_settings' => [ |
|
30 | - 'class' => '\Ingenerator\KohanaView\TemplateManager\CFSTemplateManager', |
|
31 | - 'arguments' => ['%kohanaview.template.compiler%', '@kohanaview.template_manager@'], |
|
32 | - 'shared' => TRUE, |
|
33 | - ], |
|
34 | - ], |
|
35 | - 'selector' => [ |
|
36 | - '_settings' => [ |
|
37 | - 'class' => '\Ingenerator\KohanaView\ViewTemplateSelector', |
|
38 | - 'arguments' => [], |
|
39 | - 'shared' => TRUE, |
|
40 | - ], |
|
41 | - ], |
|
42 | - ], |
|
43 | - ], |
|
10 | + 'kohanaview' => [ |
|
11 | + 'renderer' => [ |
|
12 | + 'html' => [ |
|
13 | + '_settings' => [ |
|
14 | + 'class' => '\Ingenerator\KohanaView\Renderer\HTMLRenderer', |
|
15 | + 'arguments' => ['%kohanaview.template.selector%', '%kohanaview.template.manager%'], |
|
16 | + 'shared' => TRUE, |
|
17 | + ], |
|
18 | + ], |
|
19 | + ], |
|
20 | + 'template' => [ |
|
21 | + 'compiler' => [ |
|
22 | + '_settings' => [ |
|
23 | + 'class' => '\Ingenerator\KohanaView\TemplateCompiler', |
|
24 | + 'arguments' => [], |
|
25 | + 'shared' => TRUE, |
|
26 | + ], |
|
27 | + ], |
|
28 | + 'manager' => [ |
|
29 | + '_settings' => [ |
|
30 | + 'class' => '\Ingenerator\KohanaView\TemplateManager\CFSTemplateManager', |
|
31 | + 'arguments' => ['%kohanaview.template.compiler%', '@kohanaview.template_manager@'], |
|
32 | + 'shared' => TRUE, |
|
33 | + ], |
|
34 | + ], |
|
35 | + 'selector' => [ |
|
36 | + '_settings' => [ |
|
37 | + 'class' => '\Ingenerator\KohanaView\ViewTemplateSelector', |
|
38 | + 'arguments' => [], |
|
39 | + 'shared' => TRUE, |
|
40 | + ], |
|
41 | + ], |
|
42 | + ], |
|
43 | + ], |
|
44 | 44 | ]; |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Configuration for the KohanaView module |
|
4 | - * |
|
5 | - * @author Andrew Coulton <[email protected]> |
|
6 | - * @copyright 2015 inGenerator Ltd |
|
7 | - * @license http://kohanaframework.org/license |
|
8 | - */ |
|
3 | + * Configuration for the KohanaView module |
|
4 | + * |
|
5 | + * @author Andrew Coulton <[email protected]> |
|
6 | + * @copyright 2015 inGenerator Ltd |
|
7 | + * @license http://kohanaframework.org/license |
|
8 | + */ |
|
9 | 9 | return [ |
10 | - 'template_manager' => [ |
|
11 | - // Where compiled templates should be stored |
|
12 | - 'cache_dir' => \Kohana::$cache_dir.'/compiled_templates', |
|
10 | + 'template_manager' => [ |
|
11 | + // Where compiled templates should be stored |
|
12 | + 'cache_dir' => \Kohana::$cache_dir.'/compiled_templates', |
|
13 | 13 | |
14 | - // Whether to recompile all templates on the first use of that template even if it exists |
|
15 | - 'recompile_always' => (\Kohana::$environment === \Kohana::DEVELOPMENT), |
|
16 | - ], |
|
14 | + // Whether to recompile all templates on the first use of that template even if it exists |
|
15 | + 'recompile_always' => (\Kohana::$environment === \Kohana::DEVELOPMENT), |
|
16 | + ], |
|
17 | 17 | ]; |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Andrew Coulton <[email protected]> |
|
4 | - * @copyright 2015 inGenerator Ltd |
|
5 | - * @license http://kohanaframework.org/license |
|
6 | - */ |
|
3 | + * @author Andrew Coulton <[email protected]> |
|
4 | + * @copyright 2015 inGenerator Ltd |
|
5 | + * @license http://kohanaframework.org/license |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Ingenerator\KohanaView; |
9 | 9 | |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | interface ViewModel |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @param array $variables |
|
22 | - * |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - public function display(array $variables); |
|
20 | + /** |
|
21 | + * @param array $variables |
|
22 | + * |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + public function display(array $variables); |
|
26 | 26 | |
27 | 27 | } |
@@ -16,20 +16,20 @@ |
||
16 | 16 | class InvalidDisplayVariablesException extends \InvalidArgumentException |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @param string $view_class |
|
21 | - * @param string $errors |
|
22 | - * |
|
23 | - * @return static |
|
24 | - */ |
|
25 | - public static function passedToDisplay($view_class, $errors) |
|
26 | - { |
|
27 | - return new static( |
|
28 | - sprintf( |
|
29 | - "Invalid variables provided to %s::display()\n%s", |
|
30 | - $view_class, |
|
31 | - ' - '.implode("\n - ", $errors) |
|
32 | - ) |
|
33 | - ); |
|
34 | - } |
|
19 | + /** |
|
20 | + * @param string $view_class |
|
21 | + * @param string $errors |
|
22 | + * |
|
23 | + * @return static |
|
24 | + */ |
|
25 | + public static function passedToDisplay($view_class, $errors) |
|
26 | + { |
|
27 | + return new static( |
|
28 | + sprintf( |
|
29 | + "Invalid variables provided to %s::display()\n%s", |
|
30 | + $view_class, |
|
31 | + ' - '.implode("\n - ", $errors) |
|
32 | + ) |
|
33 | + ); |
|
34 | + } |
|
35 | 35 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Andrew Coulton <[email protected]> |
|
4 | - * @copyright 2015 inGenerator Ltd |
|
5 | - * @license http://kohanaframework.org/license |
|
6 | - */ |
|
3 | + * @author Andrew Coulton <[email protected]> |
|
4 | + * @copyright 2015 inGenerator Ltd |
|
5 | + * @license http://kohanaframework.org/license |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Ingenerator\KohanaView\Exception; |
9 | 9 | |
@@ -15,22 +15,22 @@ discard block |
||
15 | 15 | */ |
16 | 16 | class InvalidTemplateContentException extends \InvalidArgumentException |
17 | 17 | { |
18 | - /** |
|
19 | - * @param string $escape_method |
|
20 | - * @param string $source_fragment |
|
21 | - * |
|
22 | - * @return static |
|
23 | - */ |
|
24 | - public static function containsImplicitDoubleEscape($escape_method, $source_fragment) |
|
25 | - { |
|
26 | - return new static( |
|
27 | - "Invalid implicit double-escape in template - remove $escape_method from `$source_fragment` or mark as raw" |
|
28 | - ); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @param string $escape_method |
|
20 | + * @param string $source_fragment |
|
21 | + * |
|
22 | + * @return static |
|
23 | + */ |
|
24 | + public static function containsImplicitDoubleEscape($escape_method, $source_fragment) |
|
25 | + { |
|
26 | + return new static( |
|
27 | + "Invalid implicit double-escape in template - remove $escape_method from `$source_fragment` or mark as raw" |
|
28 | + ); |
|
29 | + } |
|
30 | 30 | |
31 | - public static function forEmptyTemplate() |
|
32 | - { |
|
33 | - return new static('Cannot compile empty template'); |
|
34 | - } |
|
31 | + public static function forEmptyTemplate() |
|
32 | + { |
|
33 | + return new static('Cannot compile empty template'); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | class InvalidViewVarAssignmentException extends \BadMethodCallException |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @param string $view_class |
|
21 | - * @param string $var_name |
|
22 | - * |
|
23 | - * @return static |
|
24 | - */ |
|
25 | - public static function forReadOnlyVar($view_class, $var_name) |
|
26 | - { |
|
27 | - return new static( |
|
28 | - $view_class.' variables are read-only, cannot assign '.$var_name |
|
29 | - ); |
|
30 | - } |
|
19 | + /** |
|
20 | + * @param string $view_class |
|
21 | + * @param string $var_name |
|
22 | + * |
|
23 | + * @return static |
|
24 | + */ |
|
25 | + public static function forReadOnlyVar($view_class, $var_name) |
|
26 | + { |
|
27 | + return new static( |
|
28 | + $view_class.' variables are read-only, cannot assign '.$var_name |
|
29 | + ); |
|
30 | + } |
|
31 | 31 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Andrew Coulton <[email protected]> |
|
4 | - * @copyright 2015 inGenerator Ltd |
|
5 | - * @license http://kohanaframework.org/license |
|
6 | - */ |
|
3 | + * @author Andrew Coulton <[email protected]> |
|
4 | + * @copyright 2015 inGenerator Ltd |
|
5 | + * @license http://kohanaframework.org/license |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Ingenerator\KohanaView\Exception; |
9 | 9 | |
@@ -15,26 +15,26 @@ discard block |
||
15 | 15 | */ |
16 | 16 | class TemplateCacheException extends \RuntimeException |
17 | 17 | { |
18 | - /** |
|
19 | - * @param string $path |
|
20 | - * |
|
21 | - * @return static |
|
22 | - */ |
|
23 | - public static function cannotCreateDirectory($path) |
|
24 | - { |
|
25 | - return new static( |
|
26 | - "Cannot create template cache directory in '$path'" |
|
27 | - ); |
|
28 | - } |
|
18 | + /** |
|
19 | + * @param string $path |
|
20 | + * |
|
21 | + * @return static |
|
22 | + */ |
|
23 | + public static function cannotCreateDirectory($path) |
|
24 | + { |
|
25 | + return new static( |
|
26 | + "Cannot create template cache directory in '$path'" |
|
27 | + ); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param string $path |
|
32 | - * |
|
33 | - * @return static |
|
34 | - */ |
|
35 | - public static function pathNotWriteable($path) |
|
36 | - { |
|
37 | - return new static("Cannot write to compiled template path '$path'"); |
|
38 | - } |
|
30 | + /** |
|
31 | + * @param string $path |
|
32 | + * |
|
33 | + * @return static |
|
34 | + */ |
|
35 | + public static function pathNotWriteable($path) |
|
36 | + { |
|
37 | + return new static("Cannot write to compiled template path '$path'"); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | } |
@@ -15,27 +15,27 @@ |
||
15 | 15 | class TemplateNotFoundException extends \InvalidArgumentException |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @param string $path |
|
20 | - * |
|
21 | - * @return static |
|
22 | - */ |
|
23 | - public static function forFullPath($path) |
|
24 | - { |
|
25 | - return new static( |
|
26 | - "Failed to include template '$path'" |
|
27 | - ); |
|
28 | - } |
|
18 | + /** |
|
19 | + * @param string $path |
|
20 | + * |
|
21 | + * @return static |
|
22 | + */ |
|
23 | + public static function forFullPath($path) |
|
24 | + { |
|
25 | + return new static( |
|
26 | + "Failed to include template '$path'" |
|
27 | + ); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param string $rel_path |
|
32 | - * |
|
33 | - * @return static |
|
34 | - */ |
|
35 | - public static function forSourcePath($rel_path) |
|
36 | - { |
|
37 | - return new static( |
|
38 | - "Cannot find template source file '$rel_path'" |
|
39 | - ); |
|
40 | - } |
|
30 | + /** |
|
31 | + * @param string $rel_path |
|
32 | + * |
|
33 | + * @return static |
|
34 | + */ |
|
35 | + public static function forSourcePath($rel_path) |
|
36 | + { |
|
37 | + return new static( |
|
38 | + "Cannot find template source file '$rel_path'" |
|
39 | + ); |
|
40 | + } |
|
41 | 41 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Andrew Coulton <[email protected]> |
|
4 | - * @copyright 2015 inGenerator Ltd |
|
5 | - * @license http://kohanaframework.org/license |
|
6 | - */ |
|
3 | + * @author Andrew Coulton <[email protected]> |
|
4 | + * @copyright 2015 inGenerator Ltd |
|
5 | + * @license http://kohanaframework.org/license |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Ingenerator\KohanaView\Exception; |
9 | 9 | |
@@ -16,25 +16,25 @@ discard block |
||
16 | 16 | class UnassignedViewVarException extends \BadMethodCallException |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @param string $view_class |
|
21 | - * @param string $var_name |
|
22 | - * @param string $hint |
|
23 | - * |
|
24 | - * @return static |
|
25 | - */ |
|
26 | - public static function forVariable($view_class, $var_name, $hint) |
|
27 | - { |
|
28 | - return new static( |
|
29 | - sprintf( |
|
30 | - 'Call %s::display(["%s" => "%s"]) before rendering a %s view', |
|
31 | - $view_class, |
|
32 | - $var_name, |
|
33 | - $hint, |
|
34 | - $view_class |
|
35 | - ) |
|
36 | - ); |
|
37 | - } |
|
19 | + /** |
|
20 | + * @param string $view_class |
|
21 | + * @param string $var_name |
|
22 | + * @param string $hint |
|
23 | + * |
|
24 | + * @return static |
|
25 | + */ |
|
26 | + public static function forVariable($view_class, $var_name, $hint) |
|
27 | + { |
|
28 | + return new static( |
|
29 | + sprintf( |
|
30 | + 'Call %s::display(["%s" => "%s"]) before rendering a %s view', |
|
31 | + $view_class, |
|
32 | + $var_name, |
|
33 | + $hint, |
|
34 | + $view_class |
|
35 | + ) |
|
36 | + ); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | |
40 | 40 | } |