PHP code example of awesome9 / options

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

    

awesome9 / options example snippets


Awesome9\Options\Options::get()
	->register(
		'awesome9',                 // Unique name which also can be used as function
		'_awesome9_plugin_options', // Option key for database
		// Defaults values.
		[
			'name' => 'Awesome9',
			'social' => [
				'facebook' => 'https://facebook.com',
				'twitter'  => 'https://twitter.com',
			]
		]
	);

Awesome9\Options\Options::get()->install();

Awesome9\Options\Options::get()->awesome9( 'name' ); // Awesome9
Awesome9\Options\Options::get()->awesome9( 'social.facebook' ); // https://facebook.com

// Temporary update for session.
Awesome9\Options\Options::get()->awesome9()->update( 'name', 'Awesome Nine' );

// Permenant update
Awesome9\Options\Options::get()->awesome9()->update( 'name', 'Awesome Nine', true );

// Temporary remove for session.
Awesome9\Options\Options::get()->awesome9()->remove( 'name' );

// Permenant remove
Awesome9\Options\Options::get()->awesome9()->remove( 'name', true );