本文整理汇总了PHP中Feature::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Feature::model方法的具体用法?PHP Feature::model怎么用?PHP Feature::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature::model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
/**
* @var $this ClientController
* @var $model Client
* @var $form AdminForm
*/
$features = Feature::model()->notCustom()->findAll();
?>
<div class="content">
<?php
if ($features) {
?>
<div class="control-group">
<label class="control-label">
Features
<input type="checkbox" id="matchingFeatures">
</label>
<div class="controls">
<table>
<tr>
<?php
foreach ($features as $key => $feature) {
?>
<td style="vertical-align: top">
<?php
echo CHtml::checkBox('Client[feature][' . $feature->fea_id . ']', $model->clientBelongsToFeature($feature->fea_id), ['class' => 'feature-box', 'value' => $feature->fea_id]);
echo CHtml::label($feature->fea_title, 'Client_feature_' . $feature->fea_id, ['class' => 'client-checkbox']);
?>
</td>
示例2: foreach
echo '<div id="customFeatures">';
if ($features) {
foreach ($features as $feature) {
if ($model->dealBelongsToFeature($feature->fea_id)) {
echo '<div class="feature-box" id="customFeature-' . $feature->fea_id . '">';
echo CHtml::hiddenField("Deal[feature][{$feature->fea_id}]", 1);
echo CHtml::link('<img src="/images/sys/admin/icons/cross.gif" alt="delete">', '', ['class' => 'delete-customFeature', 'onclick' => "deleteCustomFeature('" . $feature->fea_id . "')"]);
echo CHtml::label($feature->fea_title, '', array('style' => 'font-size:10px;'));
echo '</div>';
}
}
}
echo '</div>';
} else {
if ($featureType != 'Lettings') {
$features = Feature::model()->findAllByAttributes(['fea_type' => $featureType]);
if ($features) {
echo '<p><b>' . $featureType . '</b></p>';
$featureCnt = 0;
foreach ($features as $feature) {
$featureCnt++;
echo '<div class="feature-box">';
echo CHtml::checkBox('Deal[feature][' . $feature->fea_id . ']', $model->dealBelongsToFeature($feature->fea_id), array());
echo CHtml::label($feature->fea_title, 'Deal_feature_' . $feature->fea_id, array('style' => 'font-size:10px;'));
echo '</div>';
}
}
}
}
echo '</div>';
}
示例3: actionDeleteCustomFeature
/**
* @param $featureId
* @param $instructionId
* @param string $format
* @return int
*/
public function actionDeleteCustomFeature($featureId, $instructionId, $format = '')
{
$linkForCustomFeature = LinkInstructionToFeature::model()->findByAttributes(['dealId' => $instructionId, 'featureId' => $featureId]);
if ($linkForCustomFeature) {
$linkForCustomFeature->delete();
}
$result = Feature::model()->deleteByPk($featureId);
if ($format == 'JSON') {
echo json_encode($result);
} else {
return $result;
}
}