1. Go to this page and download the library: Download sciactive/requirephp 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/ */
\SciActive\RequirePHP::_('test', array(), function(){
class test {
public $value;
public function talk() {
echo $this->value;
}
}
// Returning a new instantiation is important if you are
// providing a service.
return new test();
});
\SciActive\RequirePHP::alias('testing', 'test');
\SciActive\RequirePHP::_(array('testing'), function($test){
$test->talk(); // Prints '<p>Hello, world.</p>'.
});
$test = \SciActive\RequirePHP::_('test');
$test->talk(); // Prints '<p>Hello, world.</p>'.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.