输入内的动画图标

时间:2017-09-26 13:08:02

标签: animation cakephp-3.0 font-awesome

如何使用 $ this-&gt; form-&gt;输入(代码)<在输入中添加字体awsome动画图标(如 fa fa-reload fa-spin )< /强>

<div class="input-wrapper"> 
    <input id="stuff"> 
    <label id ="spin" for="stuff" class="fa fa-spinner fa-spin input-icon">
    </label> 
</div> 

和css

.input-icon{ position: relative; right: 20px; } 
input{ padding-right: 20px; } 
.input-wrapper{ position: relative; }

1 个答案:

答案 0 :(得分:0)

我不知道你从css的角度来看你是想做什么的

甚至不知道这是否是使用fontAwesome的正确方法(您正在将fa类应用于标签而不是像<i>那样在echo $this->form->control( 'my_input_name', [ 'label' => [ 'text' => '', 'id' => 'spin', 'class' => "fa fa-spinner fa-spin input-icon" ], 'templates' => [ 'inputContainer' => '<div class="input-wrapper">{{content}}</div>', 'formGroup' => '{{input}}{{label}}', ] ] ) 中使用

所以我将向您展示如何使用cakephp复制您的确切html

如果您只想使用一个命令,则必须利用模板。您可以仅为一个表单更改表单模板,也可以为整个应用程序更改表单模板。

在我的用法中,我正在为这个控件更改模板

{
    "polyline1": [
        [25.774252, -80.190262],
        [18.466465, -66.118292],
        [32.321384, -64.75737]
    ],
    "polyline2": [

        [32.321384, -64.75737],
        [36.321384, -88.75737]
    ],
    "polyline3": [

        [20.466465, -68.118292],
        [34.321384, -66.75737],
        [27.774252, -82.190262]
    ]
}