Skip to content

Instantly share code, notes, and snippets.

@crazylion
Created March 4, 2011 06:33
Show Gist options
  • Save crazylion/854269 to your computer and use it in GitHub Desktop.
Save crazylion/854269 to your computer and use it in GitHub Desktop.
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php
//應該是這樣
if($field->widgetView($profile)){
echo $field->widgetView($profile);
}else{
$return_str;
if($field->range){
$return_str = Profile::range($field->range,$profile->getAttribute($field->varname);
}else{
$return_str = $profile->getAttribute($field->varname);
}
echo CHtml::encode($return_str);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment