Function render_css_class
Renders CSS class names into a string suitable for the HTML
class
attribute.
<?php
namespace Brickrouge;
$class_names = array
(
'node-id' => 'node-id-13',
'node-slug' => 'node-slug-example',
'is-active' => true,
'is-disabled' => false
);
echo render_css_class($class_names); // "node-id-13 node-slug-example is-active"
echo render_css_class($class_names, array('node-id', 'is-active')); // "node-id-13 is-active"
echo render_css_class($class_names, 'node-id is-active'); // "node-id-13 is-active"
echo render_css_class($class_names, '-node-slug'); // "node-id-13 is-active"
Parameters summary
array |
$names |
CSS class names.
|
string|array |
$modifiers = null |
CSS class names modifiers.
|
Return value summary