dev-master
9999999-devA simple PHP framework
MIT
The Requires
The Development Requires
framework php
dev-add-license-1
dev-add-license-1A simple PHP framework
MIT
The Requires
framework php
Wallogit.com
2017 © Pedro Peláez
A simple PHP framework
A simple PHP framework inspired by Laravel, (*1)
Vertex makes use of Composer to autoload its dependencies. Be sure to run the following command after downloading the framework., (*3)
composer install
Then you can run the following command to start the built-in PHP server., (*4)
php -S localhost:8000 -t public
All configuration options are specified in the .env file in the root directory. By default you will get an example file to get you started., (*5)
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=databasename DB_USERNAME=root DB_PASSWORD=root
There is also the option of manually declaring your setting in the /config directory. Simply go into any of the files in this directory and manually replace the getenv() functions with your desired configuration., (*6)
You can easily access any of your config options in Vertex by using the Config::get() method. Supply a string to the method (eg Config::get('database')) and it will return an array of all the values specified in that file, in this case it would be /config/database.php., (*7)
Vertex uses FastRoute for all its routing needs. Routes are stored in the app/routes.php file. Please visit the following repo for full documentation https://github.com/nikic/FastRoute., (*8)
Here are some example routes:, (*9)
/* standard routes */
$route->get('/test', 'ControllerName@MethodName');
$route->post('/test', 'ControllerName@MethodName');
$route->put('/test', 'ControllerName@MethodName');
$route->delete('/test', 'ControllerName@MethodName');
/* route with parameters */
$route->get('/test/{parameter}', 'ControllerName@MethodName');
/* route with closure */
$route->get('/test', function(){
return 'Test!';
});
/* route group */
$route->addGroup('/admin', function ($route) {
$route->get('/dashboard', 'AdminController@dashboard'); // admin/dashboard
$route->get('/pages', 'AdminController@pages'); // admin/pages
$route->get('/posts', 'AdminController@posts'); // admin/posts
});
Vertex uses Laravels fantastic Blade templating engine. Views are stored in the app/resources/views/ directory and must have the file extension of .blade.php. Please visit https://laravel.com/docs/5.3/blade for full documentation., (*10)
Here is an example blade template:, (*11)
<html>
<head>
<title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
A simple PHP framework
MIT
framework php
A simple PHP framework
MIT
framework php