1. Go to this page and download the library: Download shopbase/globalizer 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/ */
shopbase / globalizer example snippets
\Shopbase\Globalizer\Globalizer::init(); // initialize the globalizer and add a gobal instance
\Shopbase\Globalizer\Globalizer::get(); // get the global instance
\Shopbase\Globalizer\Globalizer::reset(); // reset the global instance
\Shopbase\Globalizer\Globalizer::delete(); // delete the global instance
setClass(string $class) // Set new global instance of an class
getClass(string $class) // get global instance of an class
removeClass(string $class) // remove global instance of an class
syncWithGlobal() // sync global instances
class Foo
{
protected $bar = 'FooBar';
public function getBar() : string
{
return $this->bar;
}
}
\Shopbase\Globalizer\Globalizer::init()->setClass('Foo');
echo \Shopbase\Globalizer\Globalizer::get()->getClass('Foo');
// Result will be: 'FooBar';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.