getConstants() public static method

Get all icon constants for dropdown list in example
public static getConstants ( boolean $html = false ) : array
$html boolean whether to render icon as array value prefix
return array
示例#1
0
 public function testGetConstants()
 {
     $this->assertNotEmpty(FA::getConstants(false));
     $this->assertNotEmpty(FA::getConstants(true));
 }
示例#2
0
            <?php 
    echo $form->field($node, $nameAttribute, ['addon' => ['prepend' => ['content' => Inflector::titleize('menu_name')]]])->textInput($inputOpts)->label(false);
    ?>
        </div>


    </div>

    <div class="row">
        <div class="col-sm-8">
            <?php 
    if (isset($module->treeViewSettings['fontAwesome']) && $module->treeViewSettings['fontAwesome'] == true) {
        ?>
                <?php 
        echo $form->field($node, $iconAttribute)->widget(\kartik\select2\Select2::classname(), ['name' => 'Tree[' . $iconAttribute . ']', 'model' => $node, 'attribute' => $iconAttribute, 'addon' => ['prepend' => ['content' => Inflector::titleize($iconAttribute)]], 'data' => FA::getConstants(true), 'options' => ['id' => 'tree-' . $iconAttribute, 'placeholder' => Yii::t('app', 'Type to autocomplete'), 'multiple' => false], 'pluginOptions' => ['escapeMarkup' => new \yii\web\JsExpression("function(m) { return m; }"), 'allowClear' => true]])->label(false);
        ?>
            <?php 
    } else {
        ?>
                <?php 
        echo $form->field($node, $iconAttribute, ['addon' => ['prepend' => ['content' => Inflector::titleize($iconAttribute)]]])->textInput($inputOpts)->label(false);
        ?>
            <?php 
    }
    ?>
        </div>
        <div class="col-sm-4">
            <?php 
    echo $form->field($node, $iconTypeAttribute)->widget(\kartik\select2\Select2::classname(), ['name' => 'Tree[' . $iconTypeAttribute . ']', 'model' => $node, 'attribute' => $iconTypeAttribute, 'addon' => ['prepend' => ['content' => Inflector::titleize($iconTypeAttribute)]], 'data' => [TreeView::ICON_CSS => 'CSS Suffix', TreeView::ICON_RAW => 'Raw Markup'], 'options' => ['id' => 'tree-' . $iconTypeAttribute, 'placeholder' => Yii::t('app', 'Select'), 'multiple' => false] + $inputOpts, 'pluginOptions' => ['allowClear' => false]])->label(false);
    ?>