using smarty in phpstrom
hi, i amm new to phpstrom and coding, i have installed it. i am not able to run smarty, i have create one tpl file and one php, but phpstrom says smarty is not available...
do i have to include any smarty library, any tutorial that can help?
Please sign in to leave a comment.
Hi there,
Yes -- PhpStorm does not come bundled with any PHP libraries -- you have to install them yourself.
http://www.smarty.net/docs/en/ -- look at the end at section called "List of examples"
Since you ar enew to both PhpStorm and PHP itself .. I may only suggest to start here:
thanks, i think the plugin is enabled coz i can see delimiter options in settings for smarty.
Here is the scenario that i have, could you point me to a solution.
1. Test.tpl (smarty file)
add little html + smarty tags
2. Test.PHP
code
{
How should i start here, should i include any file,
$smarty = new Smarty();.... gives error
}
i have seen somewhere that we need to include smarty file path at the top, but that did not work either;
give me few hints on how to get started.
Thanks,
Smarty support plugin has nothing to do to the actual Smarty PHP library -- you need to get copy of Smarty library (.php files) in order to use it in your code.
You should read the Smarty docs (where to get it; how to install and use it) -- the first link I gave you.
This forum is about PhpStorm and not "how to learn PHP"
Quick search on Google shows these video links:
THanks,
by the way i am not silly to ask here how to get started with PHP, i meant to say about smarty and phpstrom ...
Thanks for help....:)
There is nothing special about Smarty support in PhpStorm.
PhpStorm just offers basic syntax checking and highlighting for Smarty code/tags; code completion for standard tags plus possibly few other small things -- that's about it.
Anything else -- you just work with Smarty as with ordinary PHP library: place it somewhere in your project (or reference it in other way if you already know how this all works) and then just use include/require to use it in your PHP files.
Videos from previous post show how to work with Smarty in general -- you can apply exactly the same to PhpStorm (I mean: code & file location etc -- not the IDE shortcuts or stuff like that).
Thankyou Andriy for input. Will check it.