PHP code example of louislam / louislam-crud

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

    

louislam / louislam-crud example snippets


    
    
    RUD\SlimLouisCRUD;
    use RedBeanPHP\R;
    

    R::setup('sqlite:dbfile.db');
    

    R::setup( 'mysql:host=localhost;dbname=mydatabase', 'user', 'password' );
    

    $crud = new SlimLouisCRUD();
    

    // Add a Route for "product" table
    $crud->add("product", function () use ($crud) {
    
        // Show and Ordering the fields
        $crud->showFields([
            "id", 
            "name", 
            "price", 
            "description"
        ]);
        
    });
    

    $crud->run();
    

   http://<your hostname>/index.php/crud/product