Re: [SMARTY-GENERAL] Thoughts on extending Smarty to handle .NET style form validation

From: Date: Wed, 03 Apr 2002 19:52:20 +0000
Subject: Re: [SMARTY-GENERAL] Thoughts on extending Smarty to handle .NET style form validation
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3474@lists.php.net to get a copy of this message
Just to chime in a bit, I have played with this functionality of asp.net myself and must agree that it is nice. :) Of course it's not nice enough to warrant the hassle of dealing with the rest of .net. Also nice are the built-in (and sure to be added to by vendors for $$) plugins such as a calendar that you can add to the page with a line or two (which smarty does an excellent job with itself). However, my first impression when playing with this was that Microsoft will probably have the advtange of 3rd party developers contributing additional plugins. On Wed, Apr 03, 2002 at 08:40:02PM +0100, Simon Willison wrote: > A friend of mine is experimenting with ,NET at the moment (I haven't had > a chance to try it) and has been enthusing about .NET's form validation > controls. Apparently when writing a page in ASP.NET you can drop in a > single line of code which describes a text box input + associated > validation rules. The .NET architecture will then... > > * Render the HTML for the form element > * Add a javascript validation control to check (client side) the > validity of the data > * Add a server side validation control to double check data as it come > in, and if there is a problem... > ... re-display the form with a custom error message at the top, all > previous form information filled in and some kind of alert next to the > element containing the invalid data > > I should stress that I have not seen this system and I am describing it > second hand, but it sounds fantastic - I (and other PHP developers I am > sure) spend a large proportion of my time coding the same validation > features over and over again, and a one-line client AND server side > validation solution would be fantastic. > > Anyway - it would seem that Smarty is /almost/ the ideal framework for > this kind of code. I am planning a set of Smarty custom tags (along the > lines of the html_select one) to implement the functionality described > above, or at least as close to it as I can get. I say "almost" because > the system described above needs to be able to intercept form data once > it has been "posted" in order to apply the server side validation, and > this does not fall within Smarty's realm of influence. > > I say I am planning these tags, but at the moment they are more a set of > ideas floating around in my head. I am throwing this open to the Smarty > list in the hope that people can help me flesh out the ideas and help me > produce something that would be of real use to the Smarty community (I > doubt my form validation system would end up added to Smarty as the > validation aspects would have to be implemented outside the template > layer, but I'd to release the eventual system as a complement to > Smarty). In particular I am interested in ideas as to how to implement > the server side validation in an elegant way (at the moment I am > thinking of having a validation "object" which recieves the contents of > the $_GET or $_POST arrays). > > Thanks, > > Simon Willison > simon@incutio.com > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#3474) next »