PHP code example of shaggy8871 / frame

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

    

shaggy8871 / frame example snippets



* Format:
 * 'domain' => ['Project name', '/path/to/project/files', debugMode]
 */
$projects = [
    $_SERVER['HTTP_HOST'] => ['Myapp', '../src', true],
];

$app = new Frame\Core\Init($projects);

// Start 'em up
$app->run();




namespace Myapp\Controllers;

use Frame\Core\Controller;
use Frame\Core\Url;
use Frame\Request\Get;
use Frame\Response\Twig;

class Index extends Controller
{

    /**
     * Add your controller-specific route lookups here if  Frame',
            'content' => 'You\'re on the home page. You can customize this view in <Yourapp>/Views/Index/default.html.twig and <Yourapp>/Views/base.html.twig.'
        ];

    }

    /**
     * This is an example about us page
     */
    public function routeAbout(Get $request, Twig $response)
    {

        $response->setViewFilename('Index/default.html.twig');

        return [
            'title' => 'About Us',
            'content' => 'You can customize this page in <Yourapp>/Views/Index/about.html.twig.'
        ];

    }

}