PHP code example of lantern-lighthouse / responsivity

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

    

lantern-lighthouse / responsivity example snippets


use Responsivity\Responsivity;

// Simple success response
Responsivity::respond(['success' => true, 'data' => $data]);

// Error response
Responsivity::respond(
    ['error' => 'Not found'],
    Responsivity::HTTP_Not_Found
);

// Created response
Responsivity::respond(
    ['id' => 123, 'message' => 'Resource created'],
    Responsivity::HTTP_Created
);

$f3 = \Base::instance();
Responsivity::render($f3, 'pages/home.html');

$f3 = \Base::instance();
Responsivity::updateConfigValue($f3, 'database.host', 'localhost');
Responsivity::updateConfigValue($f3, 'app.debug', true);