Yesterday the main work is to change the Adminlte with Laravel template, mainly related to some laravel installation, commissioning and so on
1, install Laravel, first need to install a call composer things, composer is the package management tool of PHP, to the official website to download Composer_windows installation package, directly double-click installation, but there is a hint that the PHP's OpenSSL is not open,
2. Open php.ini to remove the Extension=php_openssl.dll ";", then the PHP folder under the Ssleay32.dll,libeay32.dll, there is a I am here in the Php/ext folder under the Php_ Openssl.dll, copy these three files to Windows/system32, and finally restart Apache, I have to restart the Administrator account (unexplained), restart the command httpd-k restart, If you do not join the environment variable, you need to go to apache24/bin under the command, to open the PHP OpenSSL success,
3, and then back to the Composer Installation Wizard, you can directly next installation success, with the command composer Create-project laravel/laravel MyApp-- Prefer-dist Create a project called MyApp Laravel, I have created this project in my root directory, set the route to be in app/http/routes.php
Route::get (' admin ', function () { return view (' Admin_template ');});
To create a admin_template.blade.php template under the resources/views/folder, but I found that the routing failed, only the home page can be routed, studied for a long time, finally found a viable solution, reference HTTP// Www.bubuko.com/infodetail-974728.html, after all set up, finally successfully routed
4, solve the problem of routing, but also encountered a new problem is that the static resources can not be loaded CSS and JS, because Admin_ template.blade.php template to modify the path, is to write the relative path, I put resources directly under the MyApp, in fact, Laravel root directory is public, so do not change the relative path of the case is to retrieve the resources under public, so I moved resources to public, successfully quoted , at that time studied for a long time, should be not careful to look at the 404 path, I thought to be like Django as uniform placement, set
5, finally I put the header, footer, sidebar into three common modules, and then include to the desired page!
The above describes the Laravel installation route Module 20160720 review, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.