Html helper - get error "Loader' not found"
Permalink
I am inside custom block - file: controller.php.
I want to use html helper Methods :
http://documentation.concrete5.org/api/class-Concrete.Block.Html.Co...
I try code from 5.6 reference:
OR 5.7 reference:
In two cases i get this error:
Class 'Application\Block\HelloWorld\Loader' not found.
2) In general: What the difference between "Core::make" and "Loader::helper"?
I want to use html helper Methods :
http://documentation.concrete5.org/api/class-Concrete.Block.Html.Co...
I try code from 5.6 reference:
$html = Loader::helper('html'); $this->addHeaderItem($html->css('test.css'));
OR 5.7 reference:
$html = Core::make('helper/html'); $this->addHeaderItem($html->css('test.css'));
In two cases i get this error:
Class 'Application\Block\HelloWorld\Loader' not found.
2) In general: What the difference between "Core::make" and "Loader::helper"?
You should really use "Core::make". "Loader::helper" is deprecated and should not be used. If you are doing this code in a controller, you will have to set "Use" statements as "hutman" said. For the Core::make part that will be
In view files it should work out of the box. Let us know if you still have troubles after implementing.
use Core;
In view files it should work out of the box. Let us know if you still have troubles after implementing.
use Loader;
At the top of your controller with the namespace definitions. Core::make should be used for anything it can be, I believe Loader is only there for some backwards compatibility.