TOP-framework/framework/create/tpl/controller/index.tpl

31 lines
535 B
Smarty

<?php
namespace app\{name}\controller;
use top\library\Controller;
use top\library\http\Request;
class Index extends Controller
{
/**
*
* @route /
*
* @param Request $request
* @return array
*/
public function index(Request $request)
{
$uri = $request->uri();
(!$uri) && $this->redirect('index');
return [
'uri' => $uri,
'controller' => $request->controllerFullName(),
'method' => $request->method(),
];
}
}