Skip to content

Commit 39ef77b

Browse files
committed
Deployed with MkDocs version: 1.2.3
1 parent 4602f41 commit 39ef77b

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -591,20 +591,20 @@ <h2 id="frameworks">Frameworks</h2>
591591
</code></pre></div>
592592
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap&#39;</span><span class="p">);</span>
593593
</code></pre></div>
594-
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap3&#39;</span><span class="p">);</span>
594+
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap4&#39;</span><span class="p">);</span>
595595
</code></pre></div>
596596
<h2 id="quick-start">Quick Start</h2>
597597
<h3 id="1-create-the-form">1. Create the Form</h3>
598-
<p>To use Formr you will need to create a new form object. You can name it anything you like, so let's keep it simple and call it <code>$form</code>.</p>
598+
<p>To use Formr you will need to create a new form object. You can name it anything you like, so let's keep it simple and call it <code class="highlight"><span class="nv">$form</span></code>.</p>
599599
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">();</span>
600600
</code></pre></div>
601-
<p>There are two arguments we can pass to our new form: the Wrapper, and the Silencer. The Wrapper tells Formr how you want your forms to be laid out; such as with Bootstrap, Bulma, or just a simple <code>&lt;div&gt;</code> tag.</p>
601+
<p>There are two arguments we can pass to our new form: the Wrapper, and the Switch. The Wrapper tells Formr how you want your forms to be laid out; such as with Bootstrap, Bulma, or just a simple <code>&lt;div&gt;</code> tag.</p>
602602
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap&#39;</span><span class="p">);</span>
603603
</code></pre></div>
604-
<p>Formr will automatically echo form elements and messages to the screen, and this is usually fine. However, in some instances this is not an option, such as when using a templating framework. In these cases simply pass <code>hush</code> to the switch parameter and then manually <code>echo</code> your elements and messages.</p>
604+
<p>Formr will automatically echo form elements and messages to the screen, and this is usually fine. However, in some instances this is not an option, such as when using a templating framework. In these cases simply pass <code>hush</code> to the Switch parameter and then manually <code class="highlight"><span class="k">echo</span></code> your elements and messages.</p>
605605
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap&#39;</span><span class="p">,</span> <span class="s1">&#39;hush&#39;</span><span class="p">);</span>
606606
</code></pre></div>
607-
<p>You can also omit a framework's wrapping div (e.g.; <code>&lt;div class="form-group"&gt;</code>) by adding <code>nowrap</code> to the switch parameter.</p>
607+
<p>You can also omit a framework's wrapping div (e.g.; <code class="highlight"><span class="o">&lt;</span><span class="nx">div</span> <span class="nx">class</span><span class="o">=</span><span class="s2">&quot;form-group&quot;</span><span class="o">&gt;</span></code>) by adding <code class="highlight"><span class="nx">nowrap</span></code> to the switch parameter.</p>
608608
<div class="highlight"><pre><span></span><code><span class="nv">$form</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Formr\Formr</span><span class="p">(</span><span class="s1">&#39;bootstrap&#39;</span><span class="p">,</span> <span class="s1">&#39;nowrap&#39;</span><span class="p">);</span>
609609
</code></pre></div>
610610
<p>You can use multiple switches by separating each with a comma.

methods/index.html

+14-4
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ <h3 id="fastform">fastform</h3>
19311931
<p>This method allows you to build incredibly complex forms using simple key/value arrays and strings. <a href="../fastform/">Read the FastForm docs</a> for complete examples. Validate with the <code class="highlight"><span class="nx">fastpost</span><span class="p">()</span></code> method;</p>
19321932
<ol>
19331933
<li>The first parameter contains the array (or string) and is required.</li>
1934-
<li>If you'd like to add CSRF protection, just enter <code class="highlight"><span class="nx">CSRF</span></code> or <code class="highlight"><span class="k">TRUE</span></code> in the second parameter.</li>
1934+
<li>If you'd like to add CSRF protection, just enter either the desired SESSION timeout duration (in seconds), <code class="highlight"><span class="nx">CSRF</span></code>, or <code class="highlight"><span class="k">TRUE</span></code> in the second parameter. <code class="highlight"><span class="nx">CSRF</span></code> and <code class="highlight"><span class="k">TRUE</span></code> default to a 3600 second (1 hour) timeout.</li>
19351935
</ol>
19361936
<div class="admonition example">
19371937
<p class="admonition-title">Example</p>
@@ -1947,12 +1947,12 @@ <h3 id="fastform">fastform</h3>
19471947
<span class="p">&lt;/</span><span class="nt">form</span><span class="p">&gt;</span>
19481948
</code></pre></div>
19491949
</div>
1950-
<h3 id="fastform_multipart">fastform_multipart</h3>
1951-
<p>Identical to <code class="highlight"><span class="nx">fastform</span><span class="p">()</span></code> except that it adds the <code class="highlight"><span class="p">&lt;</span><span class="nt">form</span> <span class="na">enctype</span><span class="o">=</span><span class="s">&quot;multipart/form-data&quot;</span><span class="p">&gt;</span></code> attribute.</p>
19521950
<div class="admonition warning">
19531951
<p class="admonition-title">Warning</p>
1954-
<p>When using CSRF protection you must enable sessions by adding <code class="highlight"><span class="nb">session_start</span><span class="p">()</span></code> at the top of your file.</p>
19551952
</div>
1953+
<p>When using CSRF protection you must enable sessions by adding <code class="highlight"><span class="nb">session_start</span><span class="p">()</span></code> at the top of your file.</p>
1954+
<h3 id="fastform_multipart">fastform_multipart</h3>
1955+
<p>Identical to <code class="highlight"><span class="nx">fastform</span><span class="p">()</span></code> except that it adds the <code class="highlight"><span class="p">&lt;</span><span class="nt">form</span> <span class="na">enctype</span><span class="o">=</span><span class="s">&quot;multipart/form-data&quot;</span><span class="p">&gt;</span></code> attribute.</p>
19561956
<hr />
19571957
<h2 id="form-processors">Form Processors</h2>
19581958
<h3 id="validate">validate</h3>
@@ -2831,6 +2831,7 @@ <h3 id="send_email">send_email</h3>
28312831
<li>The required third parameter contains the message body.</li>
28322832
<li>The optional fourth parameter accepts a 'from' email address.</li>
28332833
<li>The optional fifth parameter is binary: set to <code class="highlight"><span class="k">TRUE</span></code> if you'd like to send the email as HTML.</li>
2834+
<li>The optional sixth parameter lets you pass custom mail headers as a string.</li>
28342835
</ol>
28352836
<div class="admonition example">
28362837
<p class="admonition-title">Send a plain-text email</p>
@@ -2864,6 +2865,15 @@ <h3 id="send_email">send_email</h3>
28642865
your_email: [email protected]
28652866
</code></pre></div></p>
28662867
</div>
2868+
<div class="admonition example">
2869+
<p class="admonition-title">Pass custom Headers</p>
2870+
<div class="highlight"><pre><span></span><code><span class="nv">$headers</span> <span class="o">=</span> <span class="s2">&quot;MIME-Version: 1.0</span><span class="se">\r\n</span><span class="s2">&quot;</span><span class="p">;</span>
2871+
<span class="nv">$headers</span> <span class="o">.=</span> <span class="s2">&quot;Content-Type: text/html; charset=ISO-8859-1</span><span class="se">\r\n</span><span class="s2">&quot;</span><span class="p">;</span>
2872+
<span class="nv">$headers</span> <span class="o">.=</span> <span class="s2">&quot;From: &quot;</span> <span class="o">.</span> <span class="nv">$from</span> <span class="o">.</span> <span class="s2">&quot;</span><span class="se">\r\n</span><span class="s2">&quot;</span><span class="p">;</span>
2873+
2874+
<span class="nv">$form</span><span class="o">-&gt;</span><span class="na">send_email</span><span class="p">(</span><span class="nv">$to</span><span class="p">,</span> <span class="nv">$subject</span><span class="p">,</span> <span class="nv">$message</span><span class="p">,</span> <span class="nv">$from</span><span class="p">,</span> <span class="s1">&#39;HTML&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">);</span>
2875+
</code></pre></div>
2876+
</div>
28672877
<p>If you want prettier emails while looping through the <code class="highlight"><span class="nv">$_POST</span></code> array, name your input fields with capital letters and underscores, and then prepend each name with an underscore. Prepending a field with an underscore tells Formr to replace all underscores with spaces, making for an easier to read email.</p>
28682878
<div class="admonition example">
28692879
<p class="admonition-title">Example</p>

search/search_index.json

+1-1
Large diffs are not rendered by default.

sitemap.xml

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,57 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://formr.github.io/</loc>
5-
<lastmod>2022-03-03</lastmod>
5+
<lastmod>2022-03-07</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>https://formr.github.io/blog/</loc>
10-
<lastmod>2022-03-03</lastmod>
10+
<lastmod>2022-03-07</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
<url>
1414
<loc>https://formr.github.io/fastform/</loc>
15-
<lastmod>2022-03-03</lastmod>
15+
<lastmod>2022-03-07</lastmod>
1616
<changefreq>daily</changefreq>
1717
</url>
1818
<url>
1919
<loc>https://formr.github.io/methods/</loc>
20-
<lastmod>2022-03-03</lastmod>
20+
<lastmod>2022-03-07</lastmod>
2121
<changefreq>daily</changefreq>
2222
</url>
2323
<url>
2424
<loc>https://formr.github.io/properties/</loc>
25-
<lastmod>2022-03-03</lastmod>
25+
<lastmod>2022-03-07</lastmod>
2626
<changefreq>daily</changefreq>
2727
</url>
2828
<url>
2929
<loc>https://formr.github.io/upload-files/</loc>
30-
<lastmod>2022-03-03</lastmod>
30+
<lastmod>2022-03-07</lastmod>
3131
<changefreq>daily</changefreq>
3232
</url>
3333
<url>
3434
<loc>https://formr.github.io/validation/</loc>
35-
<lastmod>2022-03-03</lastmod>
35+
<lastmod>2022-03-07</lastmod>
3636
<changefreq>daily</changefreq>
3737
</url>
3838
<url>
3939
<loc>https://formr.github.io/blog/fastform-in-the-real-world/</loc>
40-
<lastmod>2022-03-03</lastmod>
40+
<lastmod>2022-03-07</lastmod>
4141
<changefreq>daily</changefreq>
4242
</url>
4343
<url>
4444
<loc>https://formr.github.io/blog/formr-for-designers/</loc>
45-
<lastmod>2022-03-03</lastmod>
45+
<lastmod>2022-03-07</lastmod>
4646
<changefreq>daily</changefreq>
4747
</url>
4848
<url>
4949
<loc>https://formr.github.io/blog/multiple-forms-on-one-page/</loc>
50-
<lastmod>2022-03-03</lastmod>
50+
<lastmod>2022-03-07</lastmod>
5151
<changefreq>daily</changefreq>
5252
</url>
5353
<url>
5454
<loc>https://formr.github.io/blog/recaptcha/</loc>
55-
<lastmod>2022-03-03</lastmod>
55+
<lastmod>2022-03-07</lastmod>
5656
<changefreq>daily</changefreq>
5757
</url>
5858
</urlset>

sitemap.xml.gz

2 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)