PHP code example of lucasvolpati / months

1. Go to this page and download the library: Download lucasvolpati/months library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lucasvolpati / months example snippets

`

    onths\Html\Generator;

    echo (new Generator())->monthsSelectGenerator(
        'month', //id attribute
        'form-control', //classes
        'reference_month'); //name attribute

`

    onths\Html\Generator;

    echo (new Generator('en_us'))->monthsSelectGenerator(
        'month', //id attribute
        'form-control', //classes
        'reference_month'); //name attribute

`

    onths\Html\Generator;

    echo (new Generator('pt_br', 'small'))->monthsSelectGenerator(
        'month', //id attribute
        'form-control', //classes
        'reference_month'); //name attribute

`

    onths\Html\Generator;

    echo (new Generator('pt_br', 'small', 'string'))->monthsSelectGenerator(
        'month', //id attribute
        'form-control', //classes
        'reference_month'); //name attribute

`

    onths\Html\Generator;

    echo (new Generator())->monthsSelectGenerator(
        'month', //Id attribute
        'form-control', //Classes
        'reference_month', //Name attribute
        true, //If you want to set the current month option to selected
        [
            "data-some='anything'",
            "data-click='getYear'"
            ...
        ] //add data attributes, as many as you need in this format
        );