LLMS_Notifications::load_view( string $trigger, string $path = null, string $prefix = null )
Validate trigger and load its view.
Parameters Parameters
- $trigger
-
(string) (Required) Trigger id (eg: lesson_complete).
- $path
-
(string) (Optional) Full path to the view file, allows third parties to load external views.
Default value: null
- $prefix
-
(string) (Optional) Classname prefix. Defaults to "LLMS". Can be used by 3rd parties to adjust the prefix in accordance with the projects standards.
Default value: null
Return Return
(boolean) true
if the view is added and loaded, false
otherwise.
Source Source
File: includes/notifications/class.llms.notifications.php
* @return boolean `true` if the view is added and loaded, `false` otherwise. */ public function load_view( $trigger, $path = null, $prefix = null ) { // Default path for core views. if ( ! $path ) { $path = $this->get_directory() . 'views/class.llms.notification.view.' . $this->name_to_file( $trigger ) . '.php'; } if ( file_exists( $path ) ) { if ( ! is_null( $prefix ) ) { require_once $path; } $this->views[ $this->get_view_classname( $trigger, $prefix ) ] = $trigger; return true; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Removed loading of class files that don't instantiate their class in favor of autoloading. |
3.8.0 | |
3.24.0 | Introduced. |