Add multiple classes to Laravel’s IoC container? -


I created a KamBench package in Laravel 4, which is a name-space and has two directories: Models and References . Either way, Laravel is loading my model into my Models directory (I have a model in which user is named}, however, in my classes Do not know the References directory.

I want to be able to use my contextual sections in the controllers of my app without specifying my names, so I thought that ... I would like to add them to the IOI container? However, it seems that I have to create a mask category for each category which I want to add to the container. this ???? T is not desirable if I have dozens of reference sections, as it would also mean making the same amount of mask sections.

Is there a way in the Laravel to add classes to its IOC container?

If you want to use a term facades for your classes (like MyModel: : SomeAction () ) Then you have to make your facades. But I advise not to do this for so many classes.

If your classes are not found in the reference folder, then you should check your composer.json file under autoload entry or musician dump-autoload-o Do it

I use classes within the builders of the classes, so that you can do the $ This-> MyService-> Some actions () .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -