🐘MVC Framework🐘
-
-
git clone https://github.com/qnstdx/Lamantin.git
- At the root of the project folder:
composer install --ignore-platform-reqs
- if when you try to open the site you have an error loading classes then:
composer dump-autoload --optimize
- Clone Lamatin frontend (https://github.com/qnstdx/lamantin-frontend.git) and repack in '/' project
-
-
-
All you need to work is Bootstrap.php (/app/core/Bootstrap.php), Controllers (/app/http/controllers/) and Models (/app/models)
-
-
Place your html file in /public/views/
-
Go to Bootstrap.php (/app/core/Bootstrap.php) and write in the
routes()
method:
$this->router->any('/you_url', function() { return (new YouControllerName())->youName(); });
If you create new Controller (/app/http/controllers/YouControllerName.php), when write to the controller:
namespace Lamantin\App\Http\Controllers; use Lamantin\App\Core\View; class YouControllerName { //Action name which you wrote in Bootstrap.php ( return (new YouControllerName())->name() ) public function youName() { // Render you html file which you place at /public/views/ View::render("you_file_name", [ 'something' => 'something-value' ]); } }
If you don't create new controller, when choose controller (/app/http/controllers) and write this code:
public function youName() { // Render you html file which you place at /public/views/ View::render("you_file_name", [ 'something' => 'something-value' ]); }
-
-