PHP code example of sciactive / requirephp

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 example snippets




\SciActive\RequirePHP::_(array('test'), function($test){
	$test->value = '<p>Hello, world.</p>';
});

\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>'.