diff options
author | Andrey Andreev <narf@devilix.net> | 2013-08-07 12:38:16 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2013-08-07 12:38:16 +0200 |
commit | 537181090448b5ad10283dd933861b5b1de6a568 (patch) | |
tree | 2fbbe2815a356840ee840f5061fe62e96bf1feee /user_guide_src/source/helpers/form_helper.rst | |
parent | b799a0b3f09238fe46892b811025e7bf2ac81b19 (diff) | |
parent | 1c75780da904b2a56c30c693fc3e03d2145614c2 (diff) |
Merge pull request #2589 from vlakoff/feature/user-guide-cleanup
Fix a few more merge conflicts
Diffstat (limited to 'user_guide_src/source/helpers/form_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/form_helper.rst | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 5bc5887aa..8ad8f7dcd 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -47,7 +47,7 @@ The following functions are available: The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:: - <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" /> + <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send"> **Adding Attributes** @@ -57,9 +57,13 @@ The following functions are available: $attributes = array('class' => 'email', 'id' => 'myform'); echo form_open('email/send', $attributes); - The above example would create a form similar to this:: + Alternatively, you can specify the second parameter as a string:: + + echo form_open('email/send', 'class="email" id="myform"'); + + The above examples would create a form similar to this:: - <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform" /> + <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform"> **Adding Hidden Input Fields** @@ -69,6 +73,8 @@ The following functions are available: $hidden = array('username' => 'Joe', 'member_id' => '234'); echo form_open('email/send', '', $hidden); + You can skip the second parameter by passing any falsy value to it. + The above example would create a form similar to this:: <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send"> @@ -248,10 +254,10 @@ The following functions are available: Example:: $options = array( - 'small' => 'Small Shirt', - 'med' => 'Medium Shirt', - 'large' => 'Large Shirt', - 'xlarge' => 'Extra Large Shirt', + 'small' => 'Small Shirt', + 'med' => 'Medium Shirt', + 'large' => 'Large Shirt', + 'xlarge' => 'Extra Large Shirt', ); $shirts_on_sale = array('small', 'large'); @@ -389,16 +395,14 @@ The following functions are available: the box should be checked or not. Similar to the other form functions in this helper, you can also pass an - array of attributes to the function - - :: + array of attributes to the function:: $data = array( - 'name' => 'newsletter', - 'id' => 'newsletter', - 'value' => 'accept', - 'checked' => TRUE, - 'style' => 'margin:10px' + 'name' => 'newsletter', + 'id' => 'newsletter', + 'value' => 'accept', + 'checked' => TRUE, + 'style' => 'margin:10px' ); echo form_checkbox($data); @@ -495,11 +499,11 @@ The following functions are available: form to contain:: $data = array( - 'name' => 'button', - 'id' => 'button', - 'value' => 'true', - 'type' => 'reset', - 'content' => 'Reset' + 'name' => 'button', + 'id' => 'button', + 'value' => 'true', + 'type' => 'reset', + 'content' => 'Reset' ); echo form_button($data); |