当前位置: 首页>>代码示例>>PHP>>正文


PHP Feature::model方法代码示例

本文整理汇总了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>
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:31,代码来源:specifics.php

示例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>';
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:31,代码来源:_production.php

示例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;
     }
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:19,代码来源:InstructionController.php


注:本文中的Feature::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。