izica/php-html-classnames

Php generator for html classnames

1.2 2023-04-09 01:03 UTC

This package is auto-updated.

Last update: 2024-12-09 05:00:44 UTC


README

composer require izica/php-html-classnames

Usage

<?
    $sClassname = PhpHtmlClassnames::get([
        $arParams['CLASS'], //classname from variable
        'form-input', //classname from string
        'form-input--submit' => $arParams['SUBMIT'] //classname with condition 'name' => true or false
    ]);
?>
<input class="<?=$sClassname;?>" />

or Aliases

    classnames();
    cn();