Create custom helper in 5.7
Permalink
I'm trying to create my own PHP class to be used as a model for my web application in the dashboard area.
Its my understanding that using a helper is the way to achieve this, I've seen some conflicts in documentation when using 5.7. Can someone tell me where I create the files and how to include them in my single page controller?
I've been using the deprecated Loader::helper(), and the now recommended Core::make() but can't seem to get either working.
Any help really appreciated.
Its my understanding that using a helper is the way to achieve this, I've seen some conflicts in documentation when using 5.7. Can someone tell me where I create the files and how to include them in my single page controller?
I've been using the deprecated Loader::helper(), and the now recommended Core::make() but can't seem to get either working.
Any help really appreciated.
Hi,
Thanks for the links, they've been really helpful.
I've still had little success in this. I've followed the first link, following the directions quite literally for the sake of getting something working. I've attached my directory structure so show where I've put files.
In theory, I should be able to call the following and it should call my custom service (aka helper):
echo Core::make('your_package/helper/praise')->praise();
Yet, all I'm seeing on the frontend is an error:
Class your_package/helper/praise does not exist
Have you got any suggestions? Any idea where I might find an small/empty package where I can try and replicate service functionality from?
I'm getting near the point of scrapping Concrete5 as my solution at this point, its very frustrating, but I really appreciate your help - I really want to get this to work :)
Thanks,
- Chris
Thanks for the links, they've been really helpful.
I've still had little success in this. I've followed the first link, following the directions quite literally for the sake of getting something working. I've attached my directory structure so show where I've put files.
In theory, I should be able to call the following and it should call my custom service (aka helper):
echo Core::make('your_package/helper/praise')->praise();
Yet, all I'm seeing on the frontend is an error:
Class your_package/helper/praise does not exist
Have you got any suggestions? Any idea where I might find an small/empty package where I can try and replicate service functionality from?
I'm getting near the point of scrapping Concrete5 as my solution at this point, its very frustrating, but I really appreciate your help - I really want to get this to work :)
Thanks,
- Chris
Here are some links that I have on the topic.
http://www.concrete5.org/community/forums/5-7-discussion/helpers/...
http://stackoverflow.com/questions/29965533/concrete5-5-7-using-a-s...
http://www.concrete5.org/community/forums/5-7-discussion/a-few-ques...