PHP code example of 8grams / homie

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

    

8grams / homie example snippets




$name = "Glend";


 

// get database instance
$rb = $this->db->init();
$book = $rb->dispense('book');
$book->author = "glend";
$id = $rb->store( $book );

// set cache instance
$this->cache->set("book", $id);


 

$name = "Glend";

 

$name = "Glend";



// all params
$params = $this->getQueryParams();

// specific param
$name = $this->getQueryParams("name");




// all data
$params = $this->getFormData();

// specific data
$name = $this->getFormData("city");




// all data
$params = $this->getJsonPayload();

// specific data
$name = $this->getJsonPayload("name");





<section class="header">
    <p align="center">
        <img data-asset="homie_logo" alt="Homie" src=<?= $this->asset('homie_logo', 'https://raw.githubusercontent.com/8grams/homie/refs/heads/develop/assets/logo.png')