Need idea/login in adding form to template file |
[eluser]CodeIgniter Fan[/eluser]
Hi I want to develop backend for my website using ci template parser class but I have no idea on how to add forms to template file I have to pass php form fields as data variable to template file with other variables or any other technique is there?
[eluser]Michael Wales[/eluser]
Form Helper for your Views. Validation for your Controller. ErkanaAuth to tie it all together.
[eluser]CodeIgniter Fan[/eluser]
Ya I know about this for simple view files but how to add form to template file because template file uses pseudo variables.
[eluser]Michael Wales[/eluser]
You go one of three routes: 1) Use the form helper. 2) Use hand-coded HTML, just like you would on any site 3) Assign the form_helper's return, or the hand-coded HTML, to a variable, then pass that to your view [this just seems like an extra step to me] By using the template system you are not limiting yourself to just psuedo-variables - you are merely adding the ability to parse psuedo-variables.
[eluser]CodeIgniter Fan[/eluser]
ok I will rethink for in using templating system and thanks for your reply
[eluser]Majd Taby[/eluser]
You might want to take a look at JTaby (link in my signature..and new version coming out soon).
[eluser]obiron2[/eluser]
You have two choices.. If you are using MySQL then table fields can have comments added. You can then select full columns from table and get the comments. you can then store formatting and validation information in the comments (pipe or tilde delimited) alternatively you could store the form formatting as an xml string in a model or database. This way you only have to modify the xml and the forms will re-render. Obiron |
Welcome Guest, Not a member yet? Register Sign In |