system
(system)
March 23, 2009, 9:20pm
1
hi,
these are my rules:
<?
public function rules()
{
return array(
// REGISTRIERUNG
array('user, pwd, pwd_repeat, email, question, answer', 'required', 'on'=>'reg'),
array('user', 'unique', 'on'=>'reg'),
array('pwd', 'compare', 'on'=>'reg'),
?>
in the view, called reg.php i have some activeLabelEx's, but on the required labels aren't stars…
some words of advice?
qiang
(Qiang Xue)
March 23, 2009, 11:59pm
2
You need to set CHtml::$scenario='reg' before the form.
mikl
(Mike)
March 24, 2009, 8:51am
4
Qiang, do you think we should have a demo page where we show all the nice features hidden in CHtml by example? I feel, like i’m missing a lot of stuff (like the one above) here.
qiang
(Qiang Xue)
March 24, 2009, 11:22am
5
Yeah, that'll be really nice, but I'm short of time…
system
(system)
March 29, 2009, 10:19pm
6
hey…
i set the senario like this, but its not working.
what is my mistake?
<?php
<div class="yiiForm">
<p>
Felder mit <span class="required">*</span> sind Pflichtfelder.
</p>
<?php CHtml::$scenario='reg'; ?>
<?php echo CHtml::form(); ?>
<?php echo CHtml::errorSummary($agenturen); ?>
<div class="simple">
<?php echo CHtml::activeLabelEx($agenturen,'email'); ?>
?>