How do libraries work in 5.7? I am trying to utilize a custom library for use on a single page.
I have created the single page view and controller. I am able to access the controller from the view.
I also created a library in application/libraries/ called lobbreeldashboard.php.
In my controller I have Loader::library('lobbyreeldashboard');
Inside of the library there is only one function right now called sayHello()
In my controller I make a call to the function using: sayHello();
. However, I receive the following error Call to undefined function sayHello()
.
What am I missing to make this work in 5.7?
single_pages/stats.php
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$abc = new StatsController();
$abc->view();
controller/stats.php
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::library('lobbyreeldashboard');
class StatsController extends Controller {
public function view() {
$bob = sayHello();
}
}
libraries/library.php
<?php
defined('C5_EXECUTE') or die("Access Denied.");
function sayHello() {
return 'hello';
}