This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136500 - Add support for Smarty template syntax.
Summary: Add support for Smarty template syntax.
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 57 votes (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-04 20:05 UTC by rburkhead
Modified: 2011-06-22 04:15 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rburkhead 2008-06-04 20:05:45 UTC
Add support for Smarty template syntax (http://smarty.php.net).  This is a popular extension to PHP, which allows much
easier templating of dynamic web pages.

As part of this support, it would be important to allow for alternate Smarty delimiters.  The standard delimiters are
braces ('{' and '}'), however many choose to use alternate delimiters--for example, delimiters that mimic comments
('<!--[' and ']-->').

Competing products include this feature in their PHP editor offerings.
Comment 1 Tomasz Slota 2008-06-05 08:50:43 UTC
Will need parser support for that, reassigning to ppisl
Comment 2 krzpob 2008-09-26 07:47:32 UTC
I witte many application, and support will help for me.
Comment 3 josin 2008-11-06 19:23:18 UTC
Will be support for smarty in NB6.5?
Comment 4 Petr Pisl 2008-11-10 17:16:39 UTC
Officially there will not be any framework supported in NB 6.5. 
Comment 5 kajdus 2009-01-04 12:07:40 UTC
I'd like to create a plugin for Smarty in Netbeans. With that plugin I'd like to get the Netbeans Certificate. So as to
do it, I have to know that nobody's doing it now, in fact. Above of that, I'd need your acceptance and permission. If
you cannot do it for me, maybe you can indicate me the person who can.
Comment 6 Petr Pisl 2009-01-05 10:30:28 UTC
There is no plan to support Smarty in NB 7.0. It would be great if you can do it:). What is your plan? Do you have any
experience with writing NB modules?
Comment 7 kajdus 2009-01-05 14:23:55 UTC
In November I've got Netbeans Platform Cetrified Associate at the course with Geertjan. Now, I'd like to get the
NetBeans Certified Engineer by making this module for Smarty. Apart from that I'm a student at Warsaw University and
that job will be also my course project. So that my experience is this Certified Associate and jobs we have to do in my
studies.

My plan is to work on it in January and February. It'd be an editor for Smarty with traditional language features. If
you have any ideas about it, you see any difficulties or something else, please tell me about them:)
Comment 8 Petr Pisl 2009-01-07 10:29:52 UTC
There shouldn't be any difficulties, but it doesn't have to easy:). It depends, what you want exactly implement. Do you
have some short document with ideas? If yes, you can attach it to this issue. 
Comment 9 chico 2009-02-28 17:16:57 UTC
The smarty plugin has been created by kajdus :
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=15679
Comment 10 ezod 2009-06-19 16:52:50 UTC
is there any chance to get this plugin working for 6.7?
Comment 11 stereobooster 2009-08-01 22:50:29 UTC
Hi. kajdus made good job. But still some features unresolved. 
Is there any plans to add support for nb6.7, option to change from defual tags (example: {%... %} instead of {... }), more 
advanced html(js, css) support?
Is there any chance to get the source of plugin?
Thanks.
Comment 12 dpatterson 2009-08-04 18:03:22 UTC
I would absolutely love to see support for Smarty in NetBeans.
I've been using Smarty since V1.something and just recently switched from ZDE to NB.

Remember that Smarty support will need to include the ability to specify the Smarty delimiters. I switched from { and }
to {{ and }} years ago because it removes the need for {ldelim} and {rdelim}.

Thanks.
D.
Comment 13 hunt_tw 2009-08-06 01:48:24 UTC
+1, go go!

hunt
Comment 14 ussher 2009-08-27 04:46:06 UTC
essential. Cant change fully to netbeans without smarty working properly.  Love to see it.
Comment 15 nbphpuser 2009-08-27 08:21:09 UTC
At least syntax highlight, please
Comment 16 xantiva 2009-08-31 12:59:04 UTC
+1 also from me! PHP, HTML and Smarty is very essential for my work. I need the combination of Smarty *and* HTML
editing, syntax highlighting, ...

Thanks for your further work!
Comment 17 katsuke 2009-09-22 22:01:49 UTC
Hello there, is there any chance we can get the source code for this plugin [1]? i can't find it anywhere.

I'm sure if the source it's available someone (including myself) will be able to develop it further.


[1] http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=15679

Comment 18 hergo333 2009-09-28 10:11:19 UTC
The plugin from kajdus solves nothing since it is not finished and the source code is not available (so we could fix it
by ourselves). Please consider adding at least basic syntax highlighting to netbeans, either through module or native. 

There is this excellent tutorial that I have followed to make a module myself, but it is a bit outdated and the approach
seems deprecated:
http://antonioshome.net/kitchen/netbeans/index.php
Otherwise an excellent introduction to NB modules architecture. It seems a waste of time to develop things the old way,
but there is a lack of good tutorials on using the new approach. For instance, Sun's tutorials seem to follow this
pattern: "if you were using X, then use Y like this now..." - do I really need to learn to use deprecated X to start
using Y? 
Any of the following would help resolve this issue:
- source code to kajdus' plugin
- at least basic Smarty module (syntax highlighting) so we can upgrade it
- pointers to "from ground up" tutorials on NB modules (I have already invested a lot of time in this and would be happy
to make an open-source module, but I am struggling with lack of good NB info. But this request probably belongs to dev
mailing list... :)

Mind you, NB is quite useless for PHP development (for many developers, including myself) without Smarty support. 

Is anyone working on this?
Comment 19 Petr Pisl 2009-09-29 14:31:26 UTC
Officially nobody works on the Smart support yet. We talked about this support, but still not enough time to look at this. 

I don't know Smarty, but the support will be mainly in editor area. Is it right?
Comment 20 hergo333 2009-09-30 22:34:15 UTC
Smarty is a templating language for HTML (usually - not necessarily, but in 99.9%). Yes, support should be in editor
area - no debugging and similar (even if it could be done it should be done through PHP debugger, because Smarty
templates get precompiled to PHP and are then executed).

I would be happy to help out - I have a good knowledge of both Java and PHP + Smarty. The problem is that I don't know
NB platform enough and don't have the time to dive into it - so if there is a ready-made module for some other platform
that i can use and adapt, I would be happy to do it (or a tutorial how to do it / lie the one I wrote about in previous
note). I am talking about Lexer / syntax highlighting primarily, though code completion would be an interesting feature too.

Of course kajdus' module code would be great too because he has done most of the work already - but I guess nobody has
his/her contact? It's a shame to let a good piece of work die like that... 
Comment 21 acidicchip 2010-01-06 14:22:32 UTC
I too would love Smarty support... At least formatting support. I am sad to see that kajdus got 3/4 of the way done, and neglected to support one of the most important features, that being the ability to change the delimiters, as many in depth coders are likely to change the default (and problematic) delimiters.
Comment 22 gauravgs 2010-02-11 03:48:09 UTC
When I include smarty tags in my html file, the 'autoformat' doesnot work properly. It does not work as it should do, all the tags after the smarty code are arranged in the single line, identation is completely lost. please provide some help.
Comment 23 Tomas Mysik 2010-02-11 05:54:02 UTC
Possible Smarty support is an enahncement, not a defect. Thanks.
Comment 24 hergo333 2010-02-24 09:16:04 UTC
Is anyone working on this? Defect or enhancement, I don't care - it is annoying... :)
Comment 25 camronlevanger 2010-02-26 19:40:26 UTC
Yes! You kind of HAVE to support Smarty if we expect people to adopt this as a valid PHP IDE alternative. Let's make this happen.
Comment 26 Tomas Mysik 2010-03-25 12:31:13 UTC
Initial support for Smarty available, details can be found on our blog [1].

[1] http://blogs.sun.com/netbeansphp/entry/initial_support_for_smarty_available
Comment 27 badboyrx 2010-05-20 20:10:36 UTC
(In reply to comment #26)
> Initial support for Smarty available, details can be found on our blog [1].
> 
> [1] http://blogs.sun.com/netbeansphp/entry/initial_support_for_smarty_available

thanks, didnt check. i desperately waited for this.
Comment 28 Tomas Mysik 2010-05-21 07:02:51 UTC
We can close this issue, support exists. All issues please report to contrib/Smarty.

Thanks.
Comment 29 ffromdn 2011-06-21 15:31:48 UTC
+1 please
Comment 30 Martin Fousek 2011-06-22 04:15:47 UTC
ffromdn, the support already exists. See:
http://plugins.netbeans.org/plugin/37379