$app = app(); // Get the current application instance $app->register(MyServiceProvider::class); // Register a new service provider
$app = Yii::$app; // Get the current application instance $db = $app->db; // Access the database component
$ci =& get_instance(); // Get the current application instance $ci->load->helper('form'); // Load the form helper echo form_open('login'); // Access the input class to create a login formPackage library: CodeIgniter