PHP code example of fullstackpe / micro

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

    

fullstackpe / micro example snippets


 

$config = [
    'key' => 'Config value'
];

$app = new \micro\Application($config);
$queryString = $_GET;
$app->run($queryString);


 

namespace app\controller;

use micro\Controller;

class CustomCtrl extends Controller
{
    public function index() 
    {
        return $this->render('index');
    }
    
    public function home($arg1, $arg2) 
    {
        return $this->render('home', [
            'arg1' => $arg1,
            'arg2' => $arg2
        ]);
    }
}


 
return $this->render('home', [
    'arg1' => $arg1,
    'arg2' => $arg2
]);


/controllers/
    ControllerClass.php
/views/
    viewFile.php
/web/
    webassets 
    index.php

/modules/
    modulesName1/
        controllers/
            ControllerClass.php
        views/
            viewFile.php 
    modulesName2/
        controllers/
            ControllerClass.php
        views/
            viewFile.php 
/web/
    webassets 
    index.php