本文整理汇总了PHP中CForm::get_checked方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::get_checked方法的具体用法?PHP CForm::get_checked怎么用?PHP CForm::get_checked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForm
的用法示例。
在下文中一共展示了CForm::get_checked方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<p> <?php echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification de sous-menu</legend>
<p>
<label>Titre </label>
<input name="nom" type="text" value="<?php echo $nom?>" />
<?php echo CHtml::get_msginfo($error_signe['nom'])?></p>
<p>
<label>Menu </label>
<select name="idcat">
<?php echo CForm::get_option($idcat, 'categorie', 'id', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?>
</select>
<?php echo CHtml::get_msginfo($error_signe['idcat'])?> </p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> />non
<input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> />oui <?php echo $error_signe['etat']?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<?php } ?>
<!-- InstanceEndEditable --></div>
</div>
<hr class="clearfloat" />
</div>
</div>
</body>
<!-- InstanceEnd --></html>
示例2: if
?>
<?php if($a == 5) { ?>
<form id="form_modif" method="post" action="image_menu.php" enctype="multipart/form-data">
<p> <?php echo CForm::get_hidden(55) ?> </p>
<p> <?php echo CForm::get_hidden($id, 'id') ?> </p>
<fieldset>
<legend>Formulaire de modification d'image</legend>
<p>
<label>Image actuel</label>
<input id="image" name="image" type="file" onchange="render_ziplabel($F('image'))"/>
<?php echo CHtml::get_msginfo($error_signe['image'])?></p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> />
non
<input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> />
oui <?php echo CHtml::get_msginfo($error_signe['etat'])?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
<div id="menu-image"><img src="<?php echo $image; ?>" alt="Image menu"/></div>
</fieldset>
</form>
<?php } ?>
<!-- InstanceEndEditable --></div>
</div>
<hr class="clearfloat" />
</div>
</div>
</body>
<!-- InstanceEnd --></html>
示例3:
<label>Texte </label>
<select name="texId" tmt:message="Veuillez sélectionner le champ texte" tmt:required="false">
<option value="0">Aucun</option>
<?=CForm::get_option($texId, 'texte', 'id', 'nom', 1); ?>
</select>
</p>
<p>
<label>Pièce-jointe </label>
<select name="pieId" tmt:message="Veuillez sélectionner le champ piece" tmt:required="false">
<option value="0">Aucun</option>
<?=str_replace('../../userfiles/pieces_jointes/', '', CForm::get_option($pieId, 'hbpiecesjointes', 'id', 'piece', 1)); ?>
</select>
</p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?=CForm::get_checked($etat,0) ?> />non
<input type="radio" name="etat" value="1" <?=CForm::get_checked($etat,1) ?> />oui<?=CHtml::get_msginfo($error_signe['etat'])?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<?php } ?>
<!-- InstanceEndEditable --></div>
</div>
<hr class="clearfloat" />
</div>
</div>
</body>
<!-- InstanceEnd --></html>
示例4: FCKeditor
<?php
$oFCKeditor = new FCKeditor('text') ;
$oFCKeditor->BasePath = '../plug/fckeditor/';
$oFCKeditor->Value = $text;
$oFCKeditor->Height = '300';
$oFCKeditor->Width = '850';
$oFCKeditor->Config['EditorAreaCSS'] = '';
$oFCKeditor->ToolbarSet = 'Page';
$oFCKeditor->Create() ;
?>
<?php echo CHtml::get_msginfo($error_signe['text'])?></p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> <?php echo (CTableUser::is_admin($_SESSION['idmbr'])) ? "" : "disabled = 'disabled'" ?>/>
non
<input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> <?php echo (CTableUser::is_admin($_SESSION['idmbr'])) ? "" : "disabled = 'disabled'" ?>/>
oui <?php echo $error_signe['etat']?></p>
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
</form>
<?php } ?>
<!-- InstanceEndEditable --></div>
</div>
<hr class="clearfloat" />
</div>
</div>
</body>
<!-- InstanceEnd --></html>
示例5:
<label>Plage horaire</label>
<input name="heure_rdv" type="text" value="<?php echo $heure_rdv ?>"/>
</p>
<p>
<label>Type</label>
<select name="type_rdv">
<option value="0" <?php echo CForm::get_selected($type_rdv, 0) ?>>Téléphone</option>
<option value="1" <?php echo CForm::get_selected($type_rdv, 1) ?>>Société</option>
<option value="2" <?php echo CForm::get_selected($type_rdv, 2) ?>>Domicile</option>
</select>
</p>
<p>
<label>Effectué</label>
<input type="radio" value="0" <?php echo CForm::get_checked($etat_rdv, 0) ?> name="etat_rdv"/>
non
<input type="radio" value="1" <?php echo CForm::get_checked($etat_rdv, 1) ?> name="etat_rdv"/>
oui </p>
<h2>Commentaires</h2>
<p>
<textarea id="commentaire" name="commentaire"><?php echo $toUsers['commentaire'] ?></textarea>
</p>
<p>
<a href="javascript:;" id="AddDefaultComment">Ajouter commentaire prédéfini</a>
</p>
</div>
<hr class="clearfloat" />
<p>
<input name="creer" type="submit" value="Modifier >>"/>
</p>
</fieldset>
示例6: foreach
<option>Choisir le dossier</option>
<?php foreach($arr_dir as $dir) { ?>
<option <?php if($dir == $url_base) echo "selected" ?>><?php echo $dir ?></option>
<?php } ?>
</select>
</p>
<p>
<select name="url_file">
<option>Choisir le mp3</option
>
<?php foreach($arr_file as $file) { ?>
<option><?php echo $file ?></option>
<?php } ?>
</select>
</p>
<p>Lecture
<input type="radio" value="0" name="autoplay" <?php echo CForm::get_checked($autoplay,0) ?>/>manuelle
<input type="radio" value="1" name="autoplay" <?php echo CForm::get_checked($autoplay,1) ?>/>automatique
</p>
<p>
<input name="generer" type="submit" value="Générer >>"/>
</p>
<p>
<textarea><?php echo $mp3_code ?></textarea>
</p>
</fieldset>
</form>
</div>
</body>
</html>
示例7: if
<p>
<label>Titre </label>
<input name="nom" type="text" value="<? echo $nom ?>" />
<? echo CHtml::get_msginfo($error_signe['nom'])?> </p>
<p>
<label>Code postal </label>
<input name="cp" type="text" />
<? echo CHtml::get_msginfo($error_signe['cp'])?> </p>
<p>
<label>Url </label>
<input name="url" type="text" value="<? echo $url ?>" />
<? echo CHtml::get_msginfo($error_signe['url'])?> </p>
<p>
<label>Publier </label>
<input type="radio" name="actif" value="0" <? echo CForm::get_checked($etat,0) ?> />non
<input type="radio" name="actif" value="1" <? echo CForm::get_checked($etat,1) ?> />oui<? echo CHtml::get_msginfo($error_signe['actif'])?></p>
<p>
<input name="creer" type="submit" value="Ajouter >>"/>
</p>
</fieldset>
</form>
<? } ?>
<?
//----------------------------------------------------------------------------------------------
// MODIF
//----------------------------------------------------------------------------------------------
?>
<? if($a == 5) { ?>
<form id="form_modif" method="post" action="<? echo $_SERVER['REQUEST_URI'] ?>" enctype="multipart/form-data">
示例8:
</p>
</div>
<hr class="clearfloat" />
<!--<p>
<label>Texte défilant</label>
<input name="text" type="text" value="<?php echo $text?>" />
<?php echo CHtml::get_msginfo($error_signe['text'])?>
</p>
<p>
<label>Lien</label>
<input name="lien" type="text" value="<?php echo $lien?>" /></p>
<p>
<label>Défilement </label>
<input type="radio" name="defil" value="1" <?php echo CForm::get_checked($defil,1) ?> />
oui
<input type="radio" name="defil" value="0" <?php echo CForm::get_checked($defil,0) ?> />
non
</p>-->
<input type="hidden" name="id" id="id" value="<?php echo $id; ?>"/>
<p>
<input name="creer" type="submit" value="Valider >>"/>
</p>
</fieldset>
</form>
<?php } ?>
<script type="text/javascript">
$(function(){
$('#dateevent').datepicker({
//minDate:'+0d',
dateFormat: 'yy-mm-dd',
duration: '',
示例9: if
?>
<form id="form_ajout" method="post" action="hb_piecesjointes.php" enctype="multipart/form-data" tmt:validate="true">
<?php if ($a == 4) echo CForm::get_hidden(44) ; else echo CForm::get_hidden(55) ; ?>
<?php if ($a == 5) echo CForm::get_hidden($id, 'id') ; ?>
<fieldset>
<legend>Formulaire <?php if ($a == 4) echo "d'ajout" ; else echo "de modification" ; ?> de pieces jointes</legend>
<p>Ne pas depassé 10Mo pour le fichier</p>
<p>
<label>Piece </label>
<input name="piece" type="file" onchange="render_ziplabel($F('piece'))" tmt:invalidvalue="0" tmt:message="Veuillez choisir une piece" tmt:required="true"/>
<?php if ($a == 5) echo '<a href="' . $toPieces['piece'] . '" target="_blank" >' . $toPieces['piece'] . "</a>" ; ?>
</p>
<p>
<label>Publier </label>
<input type="radio" name="etat" value="0" <?php echo CForm::get_checked($toPieces['etat'], 0) ?> />non
<input type="radio" name="etat" value="1" <?php echo CForm::get_checked($toPieces['etat'], 1) ?> />oui
</p>
<p>
<input name="creer" type="submit" value="<?php if ($a == 4) echo "Ajouter" ; else echo "Modifier" ; ?> >>"/>
</p>
</fieldset>
</form>
<?php
}
?>
</div>
</div>
</body>
<!-- InstanceEnd -->