CodeIgniter – POST Zahtjev

Klasični post zahtjev iz frome Pod pretpostavkom da imamo već instaliran CodeIgniter.Pravimo kontroler: php spark make:controller Post --suffix Zatim pravimo HTML template ./app/Views/posts.php i dodajemo...
Klasični post zahtjev iz frome Pod pretpostavkom da imamo već instaliran CodeIgniter.Pravimo kontroler: php spark make:controller Post --suffix Zatim pravimo HTML template ./app/Views/posts.php i dodajemo sadržaj: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title></title> </head> <body> <form action="<?= site_url('post') ?>" method="post"> <p>Name: <?php echo $name ?></p> <p>Email: <?php echo $email ?></p> <br> <p>Unesi podatke: </p> <input type="text" name="name" placeholder="Enter name"/> <br><br> <input type="email" name="email" placeholder="Enter email"/><br><br> <button type="submit">Submit</button> </form> </body> </html> Dodajemo putanju u "/app/Config/routes.php": $routes->get('post', 'PostController::index'); $routes->post('post', 'PostController::index'); U PostController::index unosimo: public function index() { $templateData = [ 'name' => null, 'email'...