Code Comments
Programming Forum and web based access to our favorite programming groups.Hello All I wrote to this forum/list few months back about the something interesting w ith smarty, I thought let me again describe same thing here. The concept I am talking about is something different with PHP and Smarty. F or me this was not possible without using Smarty and that’s where I am very much thankful to smarty. There are few programmers whom I know who are against smarty, they says it i s taking extra resources andgoing away from basic concept of template system . It is just programming in html, this is true to some extent. However, for me, what I could do with Smarty as explained here, is not possible at all wi thout smarty. For me smarty is really a powerful tool What i wish if my concept is not worth than smarty developers can come with something like this....i am sure, would be really very useful in commercial rapid development. Amway, my concept ‘Akaar’ has few features, which are quite new with PHP dev elopmentlike BackFire, Client Validation, Insertion, and Layout Management e tc. These features can surely give pace to the development work dramaticall y. There are lots of feature for just for example, here BackFire This is bit difficult for me to explain the concept behind the Backfire in w ords; I would prefer to explain by case. Just imagine a case, you are doing coding for a registration form in which y ou will ask some information from your user like, email, password, gender, a ddress, city, country etc. The email address filed is unique in your system and you need to validate it . You must validate that the email address enter by user is unique andif it is not you must inform user to enter different email address. In such case, while informing the notice to user, you would prefer to re-fil l all the information (like city, address, gender, and country) entered byus er so they don’t need to fill again. They just enter different email address and go ahead. Now, just think, how would you do this? What is your normal way to do coding in such case and how would you re-filled the information entered by user wh ile notifying the user? I would not describe here how we do this normally, but I would surely tell y ou how you could do this in Akaar. Just by a single line of Code, yes by jus t single line ofcode like $obj->DoBackFire(); That’s all; this line of codewill do all for you. It would re-fill all the i nformation entered by user on form; you don’t require doing any coding in yo ur template or php at all. It does not matter for Akaar what kind of html el ement you have on your form. If it were select box for country then it would show the country entered by user as selected, if it was radio for gender, it would show proper radio sel ected as selected by user. For more detail information and example please visit http://www.php-india.net/Akaar/?op=BackFire Akaar Value Insertion What is this? Again, let us go by an example. To understand this, just think of a case, you have edit profile form in your member area, when your user clicks on this, you want to display a edit form with all the information filled (Which you will fetch from database) What we normally do for this? Normally we will assign the value in html code like <input type="text" name="FirstName" value="<? =$FirstName?> "> Or if we are using the templates then, in our template we will have somethin g like <input type="text" name="FirstName" value="{$FirstName} "> This is orthodox example of text box, if we have select box, we may have dif ferent way to handle this, in case or radio button, it is different, in case of check boxes, it can be again different. Now, What if you have single way of handling this, irrespective of what kind of html element you have. Like, if we have same way to put value in checkbox, list box, radio or texta rea or any such input element. Here, Akaar helps you, you use single method to handle this and you don't re quire writing of any code in your template or in your html code value tag. You just do this simply by calling setValue method. For example, in above ca se it would be something like $obj->setValue("FirstName", $FirstName); Now, your "FirstName" can be any HTML element, it can be checkbox, textbox, radio, textarea, select box or even multiple select box. Akaar takes care o f that; you don't have to bother what kind of html element it is For more detail information and example please visit http://www.php-india.net/Akaar/?op=value There are lots of other features like Client Validation, Layout Managment etc For more detail information and example please visit http://www.php-india.net/Akaar/ Any comments ? Thanks All and Thanks Smarty!!!
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.