Can’t make sense of where Helper files exist, or how loaded

Permalink
Sorry if this is an uber-newbie question.

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

$v->requireAsset('core/file-manager');


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

./web/concrete/src/Utility/Service/Validation/Numbers.php

Awesome!

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?

Thanks

p.s. I was looking for a helper that allows me to map files to catagories/topics, if that ever can exist.

ntisithoj
 
Darragi replied on at Permalink Best Answer Reply
Hi ntisithoj,

Check this plugin:
http://www.concrete5.org/marketplace/addons/exchangecore-developer-...

It shows all available helpers and namespaces for concrete 5.7

Hope that helps,

Best,
Darragi
ntisithoj replied on at Permalink Reply
ntisithoj
Oh yeah! that is perfect! thansk :)
Chrouglas replied on at Permalink Reply
This would be great. Only problem is I have it where its supposed to be and it is not showing up as an option to install in the 'Add Functionality' page. Can someone confirm this is still a viable add-on before I go googling an answer to the problem I am getting from the potential solution that I found in an earlier google. I am getting to the point where I wish i could have my search engine auto populate a prefix "concrete5 5.7" each time I open it.

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. :)
ntisithoj replied on at Permalink Reply
ntisithoj
bump
Kiesel replied on at Permalink Reply
It works.

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...
surefyre replied on at Permalink Reply
surefyre
Yeah bump.

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
MrKDilkington replied on at Permalink Reply
MrKDilkington
@surefyre

I recommend reviewing the documentation:
Getting helpers in concrete5 5.7+
https://documentation.concrete5.org/developers/appendix/concrete5-ve...

Using Core::make()
$al = Core::make('helper/concrete/asset_library');

Using $app
$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.
surefyre replied on at Permalink Reply
surefyre
Cheers for that, MrK

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.

e.g.
$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.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@surefyre

I am not sure if fsID is available as a FileManager method filter in 5.7 or v8.
Kiesel replied on at Permalink Reply
I'd like to know too where the heck I'm supposed now to put my own helpers?

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?