Example #1
0
 /**
  * Get all icon constants for dropdown list in example
  * @param bool $html whether to render icon as array value prefix
  * @return array
  */
 public static function getConstants($html = false)
 {
     $arr = [];
     foreach ((new \ReflectionClass(get_class()))->getConstants() as $constant) {
         $arr[static::$cssPrefix . ' ' . static::$cssPrefix . '-' . $constant] = $html ? FA::icon($constant) . '  ' . $constant : $constant;
     }
     return $arr;
 }
Example #2
0
function icon($icon)
{
    return FA::icon($icon);
}
Example #3
0
</li>
					<li><?php 
echo Uuid::uuid('com.example');
?>
</li>
					<li><?php 
echo Uuid::uuid('com.example');
?>
</li>
				</ul>
			</div>
		</div>

	</div>

	<!-- this goes on every site file in p2made demos -->
	<br><div class="alert alert-success" role="alert">
		<ul class="fa-ul">
			<li>
				<?php 
echo FA::fw(FA::_CODE)->li()->size(FA::SIZE_LARGE);
?>
 <code><?php 
echo __FILE__;
?>
</code>
			</li>
		</ul>
	</div>
</div>
Example #4
0
    if ($active) {
        echo "<span style='color:green'>" . FA::icon('toggle-on')->x2();
    } else {
        echo "<span style='color:gray'>" . FA::icon('toggle-off')->x2();
    }
    echo "</span>";
});
Html::macro('featured', function ($active) {
    echo "<span style='color:black'>";
    if ($active) {
        echo FA::icon('star');
    } else {
        echo FA::icon('star-o');
    }
    echo "</span>";
});
Html::macro('loadingImage', function () {
    echo "<span class='loadingImage'>";
    echo FA::spin('circle-o-notch');
    echo "</span>";
});
Html::macro('saveButton', function ($text = null) {
    echo "<button type=\"submit\" class=\"button\" onclick=\"\$(this).css('width','+=15');\">";
    echo Html::loadingImage() . " ";
    if ($text == null) {
        echo Trans('admin.save');
    } else {
        echo $text;
    }
    echo "</button>";
});