I receive the following error when including a widget;
Warning: include(/includes/template/widgets/leftNavigator.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\includes\lib\widgets\class.widgets.php on line 8
when running it through using:
public static function getWidget($name) {
ob_start
include("/includes/template/widgets/" . strtolower($name) . ".php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
....
ClassName::getWidget("leftNavigator");
but if I change it too:
public static function getWidget($name) {
ob_start
include("/includes/template/widgets/leftNavigator.php");
$content = ob_get_contents();
ob_end_clean();
return $content;
}
it will work fine.
It is called in the files using;
$this->html = preg_replace('~\{widget.(\w+)\}~', Widget::getWidget("$1"), $this->html);
After removing 'strtolower(..)', I still receive the error.