Can’t make sense of where Helper files exist, or how loaded
In 5.6 there was a file called concrete/helpers/concrete/asset_library.php. Now in 5.7, I can not file that file, which is bizarre to me as what is Loader::helper('concrete/asset_library'); actually loading?
In a 5.7 tutorial (http://www.concrete5.org/documentation/recorded-trainings/advanced-blocks/advanced-block-development-part-three/) I read
Also worth noting is that although most helpers are going to be at concrete/core/helpers/ all of the concrete/ helpers are in concrete/helpers/concrete/, which puts the asset library at concrete/helpers/concrete/asset_library.php. The concrete helpers are more likely to change and are not as general use, so they are not part of the override structure.
yet, I have no folders called concrete/helpers or concrete/core (or ‘helpers’ or ‘core’) anywhere in my c57 fs.
What I do have is ‘src/Application/Service’ which seems to have helper-ish stuff, such as FileManager.php,
I also see in that file the namespace is \Concrete\Core\File\Type\Type… and that actual file is in web/concrete/src/File/Type/Type.php so, is Concrete\Core the same as web/concrete/src/ ?
But more confusion ensued when I saw in FileManager.php the line
But I only have the file ./web/concrete/css/build/core/file-manager.less… so what it is loading, and from where?
I fell into this maze simply looking for a list of all the helpers and their functions, but I could not one anywhere (if you know of one, please share, and the Helpers section ofhttp://www.concrete5.org/documentation/developers/5.6... does not count, as it does not reference many of the helpers I see in use)
For example, here is a list of all the helpers used in the C57 on Git.
Loader::helper('ajax') Loader::helper('arrays') Loader::helper('concrete/asset_library') Loader::helper('concrete/avatar') Loader::helper('concrete/composer') Loader::helper('concrete/dashboard') Loader::helper('concrete/dashboard/sitemap') Loader::helper('concrete/file') Loader::helper('concrete/scrapbook') Loader::helper('concrete/ui') Loader::helper('concrete/ui/help') Loader::helper('concrete/ui/menu') Loader::helper('concrete/upgrade/'.$ugh) Loader::helper('concrete/urls') Loader::helper('concrete/user')
Let’s say I wanted to see the code for validation/numbers. Ok, so after a bit of “find|grep” stuff, I locate the file...
Yet, nowhere does there exist an asset_library.php
Can someone please explain where all the Helpers exist, how they are located by Loader, and/or whatever else i may need to know about helpers that I do not even know to ask about?
Is there some kind of ‘PATH’ that Loader::helper walsk through to find all the locations of where helpers might be? Is it set in stone? If so, what is it, and is there a order of priority?
p.s. I was looking for a helper that allows me to map files to catagories/topics, if that ever can exist.
Check this plugin:
It shows all available helpers and namespaces for concrete 5.7
Hope that helps,
Couldn't there be a list of these somewhere?
These are the ones I needed... but i am sure its gonna come up again.
//$fm = Loader::helper('form');
$fm = Core::make('helper/form');
//$ph = Loader::helper('form/page_selector');
$ph = Core::make('helper/form/page_selector');
$ca = Loader::helper('concrete/asset_library');
//$ca = Core::make('helper/concrete/core/asset_library'); This one was an utter guess. :)
Maybe you added it to blocks instead of packages or you put the folder right after you unzipped it into the packages folder. In this case is inside the folder another folder with the same name. One folder to much...
I need the 5.8 equiv of asset_library and I can't find anything after half an hour. This is paid time I'm burning, not a hobby. Amazed there's no cross reference or even a very easy-to-find method of converting at the very least other than 'Just do Core:make instead' which for asset_library definitely does not work.
Class concrete/asset_library does not exist
I recommend reviewing the documentation:
Getting helpers in concrete5 5.7+
$al = Core::make('helper/concrete/asset_library');
$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication(); $al = $app->make('helper/concrete/asset_library');
The reason for the change to using $app is that it is supposed to be faster than using the Core::make() facade.
Now how do I get that to filter on a file Set or Set ID? [ fsID => '1' ] doesn't seem to do anything as a filterArgs param.
$picker = \Core::make('\Concrete\Core\Application\Service\FileManager');
echo $picker->file('picker', 'PickettyPick', 'Pick an image', null, [ 'fsID' => 3 ]);
Set #3 Exists and has files assigned to it.
I am not sure if fsID is available as a FileManager method filter in 5.7 or v8.
In 5.6.x I could just make a folder helper and put my file "security.php" inside. I could then load it with:
$sec = Loader::helper('security');
Simple as pie. But seems like it's not that simple anymore. Can someone shed some light on this?