-
Notifications
You must be signed in to change notification settings - Fork 61
Proposal for a code documentation #102
Comments
It would definitely help, but I see two problems:
Are there any other ideas or suggestions how we can get an IDE support for helpers from other components? |
I like the idea to add a description of all the helpers (and i18n helpers too) to the 'Renderer/PhpRenderer.php' file |
Agree with @froschdesign. It is also massively misleading, giving impression that the components are already available. I will try to use them, since IDE says they are there, and then get service manager errors about components not existing. This contradictory behavior will not be obvious to solve where the problem is. It is also a mild problem with custom view helpers. An off the wall propositions, I hope I won't get stoned for, is to maybe take advantage of composer installer that will automatically add/subtract methods from some interface in a writable directory. Custom view component, or zend\view, can implement interface from somewhere like approot\data\ViewInterface. (needed namespace and autoloading configurations added). As new composer package is installed that has view helpers, it adds another method to that interface. Users of the interface, then have proper up to date knowledge of what is available. |
Phalcon Framework has additional class-empty structures to help IDE with code completion, called "ide-stubs". https://github.com/phalcon/ide-stubs We can create, another project, called "zend-view-stubs", or something, to add this feature into IDEs. |
One thing I did is defining all `@method` declarations in a trait (one per
module). Not nice, but at least I found a use-case for traits 😋
…On 2 May 2017 17:36, "Wanderson Camargo" ***@***.***> wrote:
Phalcon Framework has additional class-empty structures to help IDE with
code completion, called "ide-stubs".
https://github.com/phalcon/ide-stubs
We can create, another project, called "zend-view-stubs", or something, to
add this feature into IDEs.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakLvZvlpVJ83DGJ6Wiw_vXt50P8Cqks5r102HgaJpZM4K4-0L>
.
|
I don't believe you're telling this, @Ocramius! LOL |
I also use traits for zend-form and zend-i18n. @weierophinney |
@froschdesign Sure, but the question is: how do these traits then get composed into the I think there are still questions to be answered... |
@weierophinney <?php
/**
* @var \Zend\View\Renderer\PhpRenderer $this
*/ With the new traits: <?php
/**
* @var \Zend\View\Renderer\PhpRenderer|\Zend\Form\View\HelperTrait|\Zend\I18n\View\HelperTrait $this
*/ Depending on which components are in use. |
Oh, I see - the traits go in the view scripts. Yes, go for it! Don't forget to add documentation for this as well, so folks know what they need to do in order to enable these IDE-centric features. |
We should add an explanation with a code example in the documentation and also a description in the DocBlock of each trait. |
What is the status of this issue? |
No, but the label "help wanted" is still present. 😉 |
@froschdesign |
@thexpand |
Btw. Thanks in advance. 👍 |
@froschdesign |
Right, because without any explanation no one knows why these traits are there. |
@froschdesign |
This repository has been closed and moved to laminas/laminas-view; a new issue has been opened at laminas/laminas-view#15. |
I propose to add the following lines to the 'Renderer/PhpRenderer.php' file
This will add IDE autocomplete for form helpers
The text was updated successfully, but these errors were encountered: