Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

What is the purpose/function of $Form in the template?


Reply


4 Posts   897 Views

Avatar
vwd

Community Member, 160 Posts

4 April 2011 at 5:02pm

Hi,

I'm trying to create a simplified template (based on the tutorial) and trying to remove unnecessary code.

I notice that the code

$Form

exists in the Tutorial template.

What does it do? From what I can tell so far, it provides the admin login form code. Does it do anything else? Is its functionality documented anywhere?

Thanks very much.

VWD.

Avatar
swaiba

Forum Moderator, 1808 Posts

6 April 2011 at 8:19am

When you have a

function Form()


in your controller - it shows it, when you don't you'll never know it was there... for example enable comments on a page and the $Form will be used.

Avatar
vwd

Community Member, 160 Posts

6 April 2011 at 10:13am

OK - Thanks for that Swaiba.

So it seems like something important, and that I have to keep in the template? (Although I'm not using comments in this instance)

Also where does the admin login form code reside?

Thanks Swaiba.

VWD.

Avatar
Willr

Forum Moderator, 5513 Posts

6 April 2011 at 8:15pm

So it seems like something important, and that I have to keep in the template? (Although I'm not using comments in this instance

You need it at least on Page.ss (or Security.ss) as that is what LoginForm renders into. UserForms (if you use it) will also use $Form.