Develop your apps using Smarty 3 and PhpStorm

PhpStorm brings Smarty 3 PHP Template Engine power to its users.
First of all it supports Smarty syntax, highlights keywords, automatically closes tags and enables autocompletion of Smarty tags in template files:

Smarty syntax highlighting in PhpStorm IDE

The IDE handles language mixtures like HTML, JavaScript and PHP code inside Smarty templates. It not only highlights HTML inside Smarty, but even provides autocompletion:

Smarty autocompletion in PhpStorm IDE

as well as useful quick-fixes. As shown on the screenshot below, the IDE offers you to adjust the image size to its original height.

Quick-fixes

Another very useful feature is the Structure view where you can overview and navigate through your template structure.

Of course, you can set custom delimiters to avoid conflicts between standard Smarty delimiters “{ }” and javascripts brackets. For example, you may set delimiters for smarty like this: “<!–{”  :

Smarty custom delimiters

In addition to Smarty support, you also get many nice IDE features such as code folding/unfolding, PhpUnit support for your projects, refactorings, a Visual Debugger based on Xdebug or Zend Debugger, and best-in-class JavaScript editing support.

» Download stable PhpStorm 1.0 with basic Smarty support
» Download PhpStorm 2.0 Early Access Preview with full Smarty 3 support

This entry was posted in Cool Feature, PhpStorm and tagged , , . Bookmark the permalink.
  • http://3run.su/id1 Amal Samally
  • http://3run.su/id1 Amal Samally
    • lera

      We’ll put much effort on fixing most of the issues until the release of PHPStorm.

  • Tank

    Come on, follow your roadmap and update it frequently.
    http://confluence.jetbrains.net/pages/viewpage.action?pageId=15801728

    I really need SASS 3 support, especially compilation support. And if you do HAML support, PHP-Storm will be the holy grail for pro front-end developers.

  • Jason Gu

    Hi

    When will the next EAP be released?

    Thanks
    Jason

  • http://twitter.com/rafib Rafi

    Me and a lot of people stay away from Smarty. Have you thought about adding the Mustache format?

  • yehosef

    Second on the mustache support – the fact that I can write one template that can be used for php and Javascript (and ruby and java and…) is pretty attractive.

  • http://jetbrains.com Alexey Korsun

    @Amal Samally
    Yes, we know. We are going to fix most of them in our 2.0 release which is planned at the end of January.

  • http://www.dphotonews.com Vladimie

    End of January? Then please correct this “(Q4 2010)” in your development roadmap for PHPStorm. Thx.

  • Cesa

    It’s great to have support for Smarty.

  • http://jetbrains.com Alexey Korsun

    @Vladimie
    Thank you, Vladimie. Corrected.

  • Sam

    Hi PhpStorm,

    How does one debug and set breakpoints in phpstorm when trying to debug smarty? i want to be able to debug it like how i am able to debug php, javascript, etc., being able to inspect the values of the variables, etc.

    thank you.

  • Sinisa

    I’m using lots of javascript inside my smarty template (I know I should do that). Can PhpStorm somehow detect this javascript (for autocompletition). The same problem is with CSS included in template file. It is, probably, not detected correctly and therefore the color boxes (really great help) are not displayed. Both Javascript and CSS is working correctly when inside CSS and JS separate file.

  • rustam.vishnyakov

    Normally JavaScript is detected inside “script” tag. If there is another way to add JavaScript code, PhpStorm may not detect it. So it depends on template.