PHP code example of jstewmc / gravity

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

    

jstewmc / gravity example snippets


# /path/to/package/.gravity/foo.php

$g->set('foo.bar.baz', true);            // defines a setting
$g->set('Foo\Bar\Baz', new StdClass());  // defines a service

# /path/to/project/file.php

$g = (new \Jstewmc\Gravity\Gravity())->pull();  // returns Gravity's manager

$g->get('foo.bar.baz');  // returns true
$g->get('Foo\Bar\Baz');  // returns the StdClass instance