1. Go to this page and download the library: Download shafiul-islam/nmvc 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/ */
shafiul-islam / nmvc example snippets
use app\core\App;
$app = new app();
//routes
$app->run();
use app\controllers\Pages;
$app->router->post('/hello',[Pages::class,'hello']);
$app->router->get('/hello','hello');
namespace app\controllers;
use app\core\Controller;
class Hello extends Controller
{
//functions
}
public function index(Request $request){
//get request
if ($request->isGet()){
$data =[
'metadata'=>[
'title'=>'hola'
]
];
$this->view('index',$data);
}
//for post request
if ($request->isPost()){}
}
$data =[
'hello'=>'this is a hello message'
]
$data =[
'metadata'=>[
'title'=>'Hello page',
'description'=>'Here is my page description',
'keywords'=>[],
'author'=>'ishaf',
]
];