LLMS_Notifications::load_controller( string $trigger, string $path = null )
Load and initialize a single controller
Parameters Parameters
- $trigger
-
(string) (Required) Trigger id (eg: lesson_complete).
- $path
-
(string) (Optional) Full path to the controller file, allows third parties to load external controllers.
Default value: null
Return Return
(boolean) true if the controller is added and loaded, false otherwise.
Source Source
File: includes/notifications/class.llms.notifications.php
* @return boolean `true` if the controller is added and loaded, `false` otherwise.
*/
public function load_controller( $trigger, $path = null ) {
// Default path for core views.
if ( ! $path ) {
$path = $this->get_directory() . 'controllers/class.llms.notification.controller.' . $this->name_to_file( $trigger ) . '.php';
}
if ( file_exists( $path ) ) {
$this->controllers[ $trigger ] = require_once $path;
return true;
}
return false;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |