Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
Lessons:2Length:11 minutes
  • Overview
  • Transcript

1.2 First Look at Slim PHP

In this lesson, I’ll show you the basics of Slim PHP for micro web apps. You’ll get an understanding of how a typical Slim application is constructed, specifically how to build and configure routes, retrieve GET and POST data, and assign and output template variables.

Code Snippet

The following snippet creates a route to render the index.phtml template. The name parameter in the URL will be passed to the template in the $args array.

$app->get('/[{name}]', function ($request, $response, $args) {
  return $this->render($response, 'index.phtml', $args);

Related Links

1.2 First Look at Slim PHP

Back to the top