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
@@ -102,6 +112,7 @@ $app->get('/hi/{name}', function ($request, $response, $args) {
102
112
]
103
113
);
104
114
$response->getBody()->write($str);
115
+
105
116
return $response;
106
117
});
107
118
@@ -114,24 +125,20 @@ $app->run();
114
125
`TwigExtension` provides these functions to your Twig templates:
115
126
116
127
*`url_for()` - returns the URL for a given route. e.g.: /hello/world
117
-
*`full_url_for()` - returns the URL for a given route. e.g.: http://www.example.com/hello/world
128
+
*`full_url_for()` - returns the URL for a given route. e.g.: https://www.example.com/hello/world
118
129
*`is_current_url()` - returns true is the provided route name and parameters are valid for the current path.
119
130
*`current_url()` - returns the current path, with or without the query string.
120
131
*`get_uri()` - returns the `UriInterface` object from the incoming `ServerRequestInterface` object
121
132
*`base_path()` - returns the base path.
122
133
123
134
You can use `url_for` to generate complete URLs to any Slim application named route and use `is_current_url` to determine if you need to mark a link as active as shown in this example Twig template:
0 commit comments