PHP code example of matthewlefevre / ken-framework

1. Go to this page and download the library: Download matthewlefevre/ken-framework 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/ */

    

matthewlefevre / ken-framework example snippets




* Sample Server File
 *
 * This outlines the general structure of the
 * server file.
 */

use KenFramework\Ken;

// CSRF (cross-site request forgery) vulnerability
// due to serving spa's on seprate local server for
// development. Remove headers before launching
// product

header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
header("Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS");

// Always returns JSON to the client
header("Content-Type: application/json");

// Instantiate app
$app = new Ken();
$app->start();