What do I need this Laravel IDE helper for? - laravel

I found this very popular package on github.
https://github.com/barryvdh/laravel-ide-helper
I've seen this used in several projects I've worked in but I am not sure what the benefits exactly are of this package. If I understand correctly it generates a file in the root of your project with a "clone" of the Laravel Framework. This should help with autocompletion.
I don't see any clear examples in the documentation.

When using with PHPStorm it does suggest autocomplete for methods and properties for facade classes. For instance Mail and DB classes are facades, and when using them, you won't have all the suggestions and also the methods will be highlighted as non existent.

Related

XD Plugin API and Components

I am trying to write an XD plugin that dynamically populates an artboard with components, but I don't see any mention of components in the XD plugin API. Is it possible to look through the file and find available components and place them on stage? Better yet, maybe even pull a component from a specific file in the cloud?
Unfortunately, it isn't possible to create symbol instances (that's what components are called in the APIs), yet. Here is the explaining quote from the plugin docs:
It is not currently possible for plugins to create a new component definition or a new SymbolInstance node, aside from using commands.duplicate to clone existing SymbolInstances.
(https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#symbolinstance)
There is a feature request open for it in the official plugin developer forums which you can vote for. According to Steve Kwak (Adobe), however, this seems to be problematic due to the edit context, meaning it may still take a while until we get API access to that.
There, unfortunately, also, as of yet, isn't any way to list the available symbols for a document. For the other asset types, this is possible via the assets module (cf. https://adobexdplatform.com/plugin-docs/reference/assets.html), but not (yet) for symbols.
I hope this helps (although it's probably not the answer you've hoped for).

symfony4 - What to use instead of Bundles?

The symfony4 documentation states that you shouldn't use Bundles in your main code anymore:
In Symfony versions prior to 4.0, it was recommended to organize your
own application code using bundles. This is no longer recommended and
bundles should only be used to share code and features between
multiple applications.
Any ideas how I can organize my code instead?
I think about having 200 entities. When they live all on the same level inside the Entity dir... that's a f****ing chaos!
Maybe namespacing/subfoldering?
PS: In django I'd think in the term of an app.
yes, I think organize your entity by domain is a good solution. Like Entity\Shop, Entity\Forum. This is also applicable to controllers, views, etc

Is it a good practice to extend a zf2 controller twice?

I Searched a lot to find the answer to this question, here on stackoverflow and over on google. But was not able to find anything...
So, my question is: It is a good practice to extend a controller (in my case BaseUserController from zfcuser) once in a module, and once more in another module?
Thanks for all your replies!
It's fine, I would not go as far as "good practice".
Excessive use of inheritance can cause you issues in any language and there are numerous of post around explaining the issues and possible solutions.
From a ZF2 perspective in doing so you will have the issue where Module B depends on Module A which may be a problem - However this really depends your application/module design.
There are other alternatives:
Aggregation -
create new functionality by taking other classes and combining them into a new class. Attach an common interface to this new class for interoperability with other code.
Use PHP traits - If you lucky enough to use the more recent versions of (PHP 5.4+) the you can simply reuse these within each controller class that requires it.
A Custom Controller Plugin - ZF2 has a "pluggable" API within the controller, meaning you can write self contained helper classes that can then be used in any controller - No need to extend. You are almost certainly using these already with $this->redirect() or $this->params() so they might be good places to start to see how they are built.

From where does my Owin console project know the controllers in another library?

I have my API controllers in an extra project separate from the console project where Owin is hosted.
The requests to the controller work, but how is that magic done?
From where does my console project know the project where my controllers are?
Enumerate all added references and check for types inheriting from ApiController?
I might disappoint you, but there should not be any magic in there. ;-)
I see two possibilities how your console project could know about the assembly where your controllers are:
You are using a Custom Assemblies Resolver (like this one here)
You are referring something in the controllers' assembly which is causing the assembly to be loaded
I gave a try to the second option and it works like a charm:

Getting started with Phil Sturgeon's CodeIgniter Template library

I'm trying to use Phil Sturgeon's CodeIgniter Template library, but I can't get it to change my pages. I read the documentation, followed the steps there,
Download
Copy to application folder
Create a views/layouts/default view
(Auto)load the library
however, it is not clear as to how the template is actually implemented. I thought that loading the view would apply the template everywhere, but it doesn't seem to work that way. I've also read about it in the CodeIgniter Wiki, but it looked too complicated to be the right answer.
How are you supposed to use Phil Sturgeon's Template with your controllers? (or views?) Am I missing something here?
It does not overload the load->view() methods, that would be bad. You need to update your controllers to use the template's syntax and methods in every instance you want to use it:
http://philsturgeon.co.uk/demos/codeigniter-template/user_guide/
You will use $this->template->build() instead of $this->load->view() in most cases, after constructing your template by defining regions, setting titles, etc.
There should have been a user guide included in your download with examples.

Resources