You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Views/README.markdown
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,16 @@ The Slim Framework provides a default View class that uses PHP template files by
4
4
5
5
## TwigView
6
6
7
-
The `TwigView` custom View class provides support for the [Twig](http://www.twig-project.org/) template library. You can use the TwigView custom View in your Slim application like this:
7
+
The `TwigView` custom View class provides support for the [Twig](http://twig.sensiolabs.org/) template library. You can use the TwigView custom View in your Slim application like this:
8
8
9
9
<?php
10
10
require 'slim/Slim.php';
11
11
require 'views/TwigView.php';
12
-
Slim::init('TwigView');
12
+
$app = new Slim(array(
13
+
'view' => 'TwigView'
14
+
));
13
15
//Insert your application routes here
14
-
Slim::run();
16
+
$app->run();
15
17
?>
16
18
17
19
You will need to configure the `TwigView::$twigOptions` and `TwigView::$twigDirectory` class variables before using the TwigView class in your application. These variables can be found at the top of the `views/TwigView.php` class definition.
@@ -24,9 +26,11 @@ The `MustacheView` custom View class provides support for the [Mustache template
Before you can use the MustacheView class, you will need to set `MustacheView::$mustacheDirectory`. This property should be the relative or absolute path to the directory containing the `Mustache.php` library.
@@ -38,9 +42,11 @@ The `SmartyView` custom View class provides support for the [Smarty](http://www.
38
42
<?php
39
43
require 'slim/Slim.php';
40
44
require 'views/SmartyView.php';
41
-
Slim::init('SmartyView');
45
+
$app = new Slim(array(
46
+
'view' => 'SmartyView'
47
+
));
42
48
//Insert your application routes here
43
-
Slim::run();
49
+
$app->run();
44
50
?>
45
51
46
52
You will need to configure the `SmartyView::$smartyDirectory`, `SmartyView::$smartyCompileDirectory` , `SmartyView::$smartyCacheDirectory` and optionally `SmartyView::$smartyTemplatesDirectory`, class variables before using the SmartyView class in your application. These variables can be found at the top of the `views/SmartyView.php` class definition.
@@ -52,11 +58,13 @@ The `BlitzView` custom View class provides support for the Blitz templating syst
52
58
<?php
53
59
require 'slim/Slim.php';
54
60
require 'views/BlitzView.php';
55
-
Slim::init('BlitzView');
61
+
$app = new Slim(array(
62
+
'view' => 'BlitzView'
63
+
));
56
64
//Insert your application routes here
57
-
Slim::run();
65
+
$app->run();
58
66
?>
59
-
67
+
60
68
Place your Blitz template files in the designated templates directory.
61
69
62
70
## HaangaView
@@ -66,9 +74,9 @@ The `HaangaView` custom View class provides support for the Haanga templating sy
66
74
<?php
67
75
require 'slim/Slim.php';
68
76
require_once 'views/HaangaView.php';
69
-
Slim::init(array(
77
+
$app = new Slim(array(
70
78
'view' => new HaangaView('/path/to/Haanga/dir', '/path/to/templates/dir', '/path/to/compiled/dir')
0 commit comments