Haehnchen / idea-php-toolbox

Collections of tools and improvements to make PhpStorm a little bit better
http://phpstorm.espend.de/php-toolbox
MIT License
158 stars 20 forks source link

targets should be lookup_string aware #48

Open oqq opened 8 years ago

oqq commented 8 years ago

Under some circumstances it is necessary to be aware to current provided lookup_string. e.g.

{
    "providers": [
        {
          "name": "template_files",
            "items": [
                {
                    "type_text": "template filename",
                    "target": "file://app/resources/templates/$1"
                }
            ]
        }
    ]
}

With this example it is possible to strg-click to any template file given by lookup_string available in some directories.

$templateParser->render('index.html.php'); or $templateParser->render('sub/path/template_file.html.php');

To go more further, it should be also possible to provide target by any other provider function/const/member/field.

e.g.

<?php
class TemplateParser 
{
    public function getRelativeTemplatePath($file = '')
    {
        return "app/resources/templates/$file";
    }
}

thanks!