我知道它的readonly属性text input,但是当从其他站点读取代码时(我的一个讨厌的习惯)我看到了不止一个实现:
<input type="text" value="myvalue" class="class anotherclass" readonly >
Run Code Online (Sandbox Code Playgroud)
和
<input type="text" value="myvalue" class="class anotherclass" readonly="readonly" >
Run Code Online (Sandbox Code Playgroud)
我甚至见过
<input type="text" value="myvalue" class="class anotherclass" readonly="true" >
Run Code Online (Sandbox Code Playgroud)
..而且我相信我看到了更多,但现在不记得确切的语法..
那么,哪一个是我应该使用的正确的呢?
我试图禁用更新规则模型上的字段,但我有错误.
我试着像:
array('date', 'constraint', 'readOnly'=>true, 'on'=>'update'),
Run Code Online (Sandbox Code Playgroud)
但我有这个错误:
"include(constraint.php):无法打开流:没有这样的文件或目录"
我可以使用htmloptions从视图禁用,但我需要从模型中执行它,因为在更新时我需要禁用超过5个字段.
我怎么能这样做?
thx提前