有没有一种方法可以在PhpStorm模板中通过配置文件来设置var?

时间:2019-08-13 20:28:19

标签: phpstorm apache-velocity

在PhpStorm中,我正在使用Apache Velocity做此php文件模板:

Php模板

<?php

defined( 'ABSPATH' ) || exit;

use function $plugin_name_namespace\Core\get_current_plugin_domain;

printf( '<article class="post-entry-content">' );
if ( has_post_thumbnail() ) {
    printf( '<a class="post-thumbnail-link" href="%s">%s</a>',
        get_the_permalink(),
        get_the_post_thumbnail()
    );
}
echo '<div class="post-content">';
printf( '<h4 class="entry-title"><a href="%s" title="%s" rel="bookmark">%s</a></h4>',
    get_the_permalink(),
    get_the_title(),
    get_the_title()
);
printf( '<div class="entry-excerpt">%s</div>' ,get_the_excerpt() );
printf('<a href="%s" class="details-link button" rel="nofollow">%s</a>',
    get_the_permalink(),
    __( "See More", get_current_plugin_domain() )
);
echo '</div>';
echo '</article>';

?>

我想以apache速度设置$plugin_name_namespace并使用配置文件(.ini,.env ...等等)中的默认值

或..

使用配置文件中的值动态填充模板。

有没有办法做到这一点?

1 个答案:

答案 0 :(得分:1)

当前无法使用,请投票给IDEA-217553,以通知该功能的任何进展