Skip to content

nadimtuhin/classnames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

classNames

php classNames generator

example

<?php

classNames("foo", "bar"); // => "foo bar"
classNames("foo", [ "bar"=> true ]); // => "foo bar"
classNames([ "foo-bar"=> true ]); // => "foo-bar"
classNames([ "foo-bar"=> false ]); // => "
classNames([ "foo" => true ], [ "bar"=> true ]); // => "foo bar"
classNames([ "foo" => true, "bar"=> true ]); // => "foo bar"

// lots of arguments of various types
classNames("foo", [ "bar"=> true, "duck"=> false ], "baz", [ "quux"=> true ]); // => "foo bar baz quux"

// other falsy values are just ignored
classNames(null, false, "bar", 0, 1, [ "baz"=> null ]); // => "bar 1"

About

php classnames generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages