M
M
Maxim Popov2016-07-05 10:32:50
IDE
Maxim Popov, 2016-07-05 10:32:50

How to use umiTemplaterPHP when developing a php template?

How to use commented lines with umiTemplaterPHP?

<?php /** @var umiTemplaterPHP $this */ ?>
<?php /** @var array $variables */ ?>

The documentation says that these are IDE hints for autocomplete output, but it doesn't say what kind of IDE and how to set it up?
Additionally, I'm interested in how to get information about the structure of arrays that are returned by php macros in a php template engine?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
i, 2016-07-05
@maxomato

This has nothing to do with umiTemplaterPHP , this is the PHPDoc documentation standard , many IDEs support it by default or with a plugin. Look for information about support for this standard in your IDE.
To document an array at the current time, the standard gives the following example :

/**
 * Initializes this class with the given options.
 *
 * @param array $options {
 *     @var bool   $required Whether this element is required
 *     @var string $label    The display name for this element
 * }
 */

To document the result, it is logical to use it like this:
/**
 * @return array {
 *     @var bool   $required Whether this element is required
 *     @var string $label    The display name for this element
 * }
 */

However, this usage may not be supported by current PHPDoc tools. There is an open discussion on this topic in the PHPDocumentor development project .
Possible solutions are discussed in the document: Documenting Associative Arrays in PHPDoc .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question