mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-25 07:17:58 +00:00
Deploying to readthedocs from @ chillerlan/php-qrcode@af284bfb53 🚀
This commit is contained in:
@@ -99,6 +99,8 @@
|
||||
<p class="caption" role="heading"><span class="caption-text">Built-In Output Modules</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QREps.html">QREps</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QREps.html#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QREps.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QREps.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QREps.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -106,6 +108,8 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QRFpdf.html">QRFpdf</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRFpdf.html#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRFpdf.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRFpdf.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QRFpdf.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -113,6 +117,8 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QRGdImage.html">QRGdImage</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRGdImage.html#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRGdImage.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRGdImage.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QRGdImage.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -120,6 +126,8 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QRImagick.html">QRImagick</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRImagick.html#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRImagick.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRImagick.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QRImagick.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -127,6 +135,8 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">QRMarkupHTML</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -134,6 +144,8 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QRMarkupSVG.html">QRMarkupSVG</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRMarkupSVG.html#example">Example</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRMarkupSVG.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRMarkupSVG.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QRMarkupSVG.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -141,6 +153,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Built-In-Output-QRString.html">QRString</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRString.html#plain-text">Plain text</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRString.html#json">JSON</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRString.html#additional-methods">Additional methods</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Built-In-Output-QRString.html#options-that-affect-this-module">Options that affect this module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Built-In-Output-QRString.html#options-that-have-no-effect">Options that have no effect</a></li>
|
||||
</ul>
|
||||
@@ -269,7 +284,93 @@
|
||||
|
||||
<section id="qrmarkuphtml">
|
||||
<h1>QRMarkupHTML<a class="headerlink" href="#qrmarkuphtml" title="Link to this heading"></a></h1>
|
||||
<p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/blob/main/src/Output/QRMarkupHTML.php">Class <code class="docutils literal notranslate"><span class="pre">QRMarkupHTML</span></code></a>: HTML output (a cheap markup substitute when SVG is not available or not an option)</p>
|
||||
<p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/blob/main/src/Output/QRMarkupHTML.php">Class <code class="docutils literal notranslate"><span class="pre">QRMarkupHTML</span></code></a>: HTML output</p>
|
||||
<p>This class is a cheap markup substitute for when SVG is not available or not an option (which was an issue before ca 2012).
|
||||
As a general rule: if you plan to display the QR Code in a web browser, you should be using the <a class="reference internal" href="Built-In-Output-QRMarkupSVG.html"><span class="std std-doc">SVG output</span></a>.</p>
|
||||
<section id="example">
|
||||
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
|
||||
<p>See: <a class="reference external" href="https://github.com/chillerlan/php-qrcode/blob/main/examples/html.php">HTML example</a></p>
|
||||
<p>Set the options:</p>
|
||||
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="nv">$options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">QROptions</span><span class="p">;</span>
|
||||
|
||||
<span class="nv">$options</span><span class="o">-></span><span class="na">outputType</span> <span class="o">=</span> <span class="nx">QROutputInterface</span><span class="o">::</span><span class="na">MARKUP_HTML</span><span class="p">;</span>
|
||||
<span class="nv">$options</span><span class="o">-></span><span class="na">cssClass</span> <span class="o">=</span> <span class="s1">'qrcode'</span><span class="p">;</span>
|
||||
<span class="c1">// default values for unassigned module types</span>
|
||||
<span class="nv">$options</span><span class="o">-></span><span class="na">markupDark</span> <span class="o">=</span> <span class="s1">'#555'</span><span class="p">;</span>
|
||||
<span class="nv">$options</span><span class="o">-></span><span class="na">markupLight</span> <span class="o">=</span> <span class="s1">'#CCC'</span><span class="p">;</span>
|
||||
<span class="nv">$options</span><span class="o">-></span><span class="na">moduleValues</span> <span class="o">=</span> <span class="p">[</span>
|
||||
<span class="c1">// finder</span>
|
||||
<span class="nx">QRMatrix</span><span class="o">::</span><span class="na">M_FINDER_DARK</span> <span class="o">=></span> <span class="s1">'#A71111'</span><span class="p">,</span> <span class="c1">// dark (true)</span>
|
||||
<span class="nx">QRMatrix</span><span class="o">::</span><span class="na">M_FINDER_DOT</span> <span class="o">=></span> <span class="s1">'#A71111'</span><span class="p">,</span> <span class="c1">// finder dot, dark (true)</span>
|
||||
<span class="nx">QRMatrix</span><span class="o">::</span><span class="na">M_FINDER</span> <span class="o">=></span> <span class="s1">'#FFBFBF'</span><span class="p">,</span> <span class="c1">// light (false)</span>
|
||||
<span class="c1">// alignment</span>
|
||||
<span class="nx">QRMatrix</span><span class="o">::</span><span class="na">M_ALIGNMENT_DARK</span> <span class="o">=></span> <span class="s1">'#A70364'</span><span class="p">,</span>
|
||||
<span class="nx">QRMatrix</span><span class="o">::</span><span class="na">M_ALIGNMENT</span> <span class="o">=></span> <span class="s1">'#FFC9C9'</span><span class="p">,</span>
|
||||
<span class="p">];</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Output in a HTML document (via PHP):</p>
|
||||
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span>
|
||||
|
||||
<span class="nv">$data</span> <span class="o">=</span> <span class="s1">'https://www.youtube.com/watch?v=dQw4w9WgXcQ'</span><span class="p">;</span>
|
||||
<span class="nv">$out</span> <span class="o">=</span> <span class="p">(</span><span class="k">new</span> <span class="nx">QRCode</span><span class="p">(</span><span class="nv">$options</span><span class="p">))</span><span class="o">-></span><span class="na">render</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span>
|
||||
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'Content-type: text/html'</span><span class="p">);</span>
|
||||
|
||||
<span class="cp">?></span>
|
||||
<span class="x"><!DOCTYPE html></span>
|
||||
<span class="x"><html lang="none"></span>
|
||||
<span class="x"><head></span>
|
||||
<span class="x"> <meta charset="UTF-8"/></span>
|
||||
<span class="x"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/></span>
|
||||
<span class="x"> <title>QRCode HTML Example</title></span>
|
||||
<span class="x"> <style></span>
|
||||
<span class="x"> div.qrcode{</span>
|
||||
<span class="x"> margin: 1em;</span>
|
||||
<span class="x"> }</span>
|
||||
|
||||
<span class="x"> /* rows */</span>
|
||||
<span class="x"> div.qrcode > div {</span>
|
||||
<span class="x"> height: 10px;</span>
|
||||
<span class="x"> }</span>
|
||||
|
||||
<span class="x"> /* modules */</span>
|
||||
<span class="x"> div.qrcode > div > span {</span>
|
||||
<span class="x"> display: inline-block;</span>
|
||||
<span class="x"> width: 10px;</span>
|
||||
<span class="x"> height: 10px;</span>
|
||||
<span class="x"> }</span>
|
||||
<span class="x"> </style></span>
|
||||
<span class="x"></head></span>
|
||||
<span class="x"><body></span>
|
||||
<span class="x"><!-- php poutput --></span>
|
||||
<span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$out</span><span class="p">;</span> <span class="cp">?></span>
|
||||
<span class="x"></body></span>
|
||||
<span class="x"></html></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="additional-methods">
|
||||
<h2>Additional methods<a class="headerlink" href="#additional-methods" title="Link to this heading"></a></h2>
|
||||
<table class="docutils align-default">
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>method</p></th>
|
||||
<th class="head"><p>return</p></th>
|
||||
<th class="head"><p>description</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p>(protected) <code class="docutils literal notranslate"><span class="pre">createMarkup(bool $saveToFile)</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">string</span></code></p></td>
|
||||
<td><p>Returns the fully parsed and rendered markup string for the given input</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>(protected) <code class="docutils literal notranslate"><span class="pre">getCssClass(int</span> <span class="pre">$M_TYPE</span> <span class="pre">=</span> <span class="pre">0)</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">string</span></code></p></td>
|
||||
<td><p>Returns a string with all css classes for the current element</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="options-that-affect-this-module">
|
||||
<h2>Options that affect this module<a class="headerlink" href="#options-that-affect-this-module" title="Link to this heading"></a></h2>
|
||||
<table class="docutils align-default">
|
||||
@@ -279,10 +380,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$eol</span></code></p></td>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$cssClass</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">string</span></code></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$cssClass</span></code></p></td>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$eol</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">string</span></code></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$markupDark</span></code></p></td>
|
||||
@@ -302,39 +403,39 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$returnResource</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$imageBase64</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$bgColor</span></code></p></td>
|
||||
<td><p>via CSS</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$drawLightModules</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$drawCircularModules</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$circleRadius</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$keepAsSquare</span></code></p></td>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$connectPaths</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$connectPaths</span></code></p></td>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$drawCircularModules</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$excludeFromConnect</span></code></p></td>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$drawLightModules</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$scale</span></code></p></td>
|
||||
<td><p>via CSS</p></td>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$excludeFromConnect</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$imageTransparent</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$keepAsSquare</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$outputBase64</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">$returnResource</span></code></p></td>
|
||||
<td><p>N/A</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">$scale</span></code></p></td>
|
||||
<td><p>via CSS</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user