Skip to content

Commit

Permalink
adding examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilimic1 committed Aug 23, 2022
1 parent 9776f6c commit 5a7da40
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Ilimic\Classnames;

/**
* @param mixed[] $args
*/
function classnames( ...$args ) : string
{
return Classnames::classnames( ...$args );
}
32 changes: 32 additions & 0 deletions examples/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use function Ilimic\Classnames\classnames;

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/helpers.php';

var_dump( classnames( 'c-article', 'c-article--small' ) );
var_dump( classnames( [
'c-article',
'c-article' => false,
] ) );

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="<?php echo classnames( 'c-box', 'c-box--small' ); ?>">
Small box.
</div>
<div class="<?php echo classnames( 'c-content' ); ?>">
<p>Hello world! This is HTML5 Boilerplate.</p>
</div>
</body>
</html>

0 comments on commit 5a7da40

Please sign in to comment.