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...
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?