PHP code example of ibnsultan / mimosa

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

    

ibnsultan / mimosa example snippets


app->get('/', function(){
  echo 'hello world!';
});

app->get('/', 'MyController@index');

response()->markup('<h1>Hello</h1>');

response()->json([
  'status' => 'success',
  'data' => 'Hello',
]);

response()->withHeader('key', 'value')->json([
  'status' => 'success',
  'data' => 'Hello',
]);

request()->get('key');

$data = request()->get(['username', 'password']);

// results: array( 'username' => 'value', 'password' => 'value' )

📁 project/
├── 📁 app/
|   ├── 📁 console/
│   ├── 📁 controllers/
│   ├── 📁 lib/
│   ├── 📁 routes/
│   ├── 📁 views/
│   │   ├── 📁 ScreenName/
│   │   └── 📁 Layouts/
│   └── 🐘 Controller.php
├── 📁 config/
├── 📁 public/
│   └── 📄 index.php
├── 📁 vendor/
├── ⚙️ .env
├── ⚙️ .htaccess
├── 📎 composer.json
├── 🐘 index.php
└── 📄 mimic