Skip to content

Shorthands

Javier edited this page Oct 22, 2021 · 2 revisions

Important: This documentation is still under construction, methods and/or properties may be missing or not fully documented


Some shorthands are bundled in this plugin, additional params are allowed.

Options Shorthands

You can use this shorthands with Form::select( 'your-shorthand' ) and Form::options( 'your-shorthand' ). To know more about these methods and additional params allowed, please read this. To build your own option shorthand please read this.

months

Fill a select with months names

use JPToolkit\HtmlHelper\Form;
...
echo Form::select( 'months' );

This outputs

<select>
  <option value="01">January</option>
  <option value="02">February</option>
  <option value="03">March</option>
  <option value="04">April</option>
  <option value="05">May</option>
  <option value="06">June</option>
  <option value="07">July</option>
  <option value="08">August</option>
  <option value="09">September</option>
  <option value="10">October</option>
  <option value="11">November</option>
  <option value="12">December</option>
</select>

weekdays

Fill a select with week days names

use JPToolkit\HtmlHelper\Form;
...
echo Form::select( 'weekdays' );

This outputs

<select>
  <option value="0">Sunday</option>
  <option value="1">Monday</option>
  <option value="2">Tuesday</option>
  <option value="3">Wednesday</option>
  <option value="4">Thursday</option>
  <option value="5">Friday</option>
  <option value="6">Saturday</option>
</select>

Image Shorthands

To know more about Html::img() method and additional params allowed, please read this, To build your img shorthand please read this.

pixel

Get a transparent pixel image

use JPToolkit\HtmlHelper\Html;
...
echo Html::img( 'pixel' );

This outputs

<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" height="1" width="1" class="image-size-custom image-pixel" alt="Pixel image" />

See Also


Change log

Version Description
1.3.0 Introduced

Clone this wiki locally