PHP code example of standart / slimcontroller
1. Go to this page and download the library: Download standart/slimcontroller library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
standart / slimcontroller example snippets
namespace MyApp\Controller;
class Home extends \SlimController\SlimController
{
public function indexAction()
{
$this->render('home/index', array(
'someVar' => date('c')
));
}
public function helloAction($name)
{
$this->render('home/hello', array(
'name' => $name
));
}
}
## Templates
Here are the two corresponding demo templates:
`templates/home/index.php`
This is the SlimController extension @ <?= $someVar