本文整理汇总了PHP中Categorie::listeCategorie方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::listeCategorie方法的具体用法?PHP Categorie::listeCategorie怎么用?PHP Categorie::listeCategorie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::listeCategorie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</tbody>
</table>
</div>
<div id="catego" class="tab-pane fade">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Nom</th>
<th>Supprimer</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$cats = $categorie->listeCategorie();
foreach ($cats as $cat) {
echo "<tr>";
echo "<td>" . $cat['idCategorie'] . "</td>";
echo "<td id='cat" . $cat['idCategorie'] . "'>" . $cat['nom'] . "</td>";
echo "<td> \n <div class='btn-group' role='group'> \n <button type='button' class='btn btn-default red' onclick=changeModalSupprCat(" . $cat['idCategorie'] . ") data-toggle='modal' data-target='#supprimerModalCat'>\n <span class='glyphicon glyphicon-remove' aria-hidden='true'></span>\n </button>\n </div> \n </div>\n </td>";
echo "</tr>";
}
?>
</tr>
</tbody>
</table>
</div>
</div>
示例2:
<div class="col-sm-4">
<input type="number" name="year" value="" class="form-control" placeholder="Entrez son année de sortie" required="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Image</label>
<div class="col-sm-4">
<input type="file" name="image">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Catégorie</label>
<div class="col-sm-4">
<select class="form-control" name="categorie">
<?php
$cats = $categories->listeCategorie();
foreach ($cats as $cat) {
echo "<option value='" . $cat['idCategorie'] . "'>" . $cat['nom'] . "</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-4">
<button type="submit" class="btn btn-default btn-primary" name="addMovie"><span class="glyphicon glyphicon-save"></span> Enregistrer</button>
</div>
</div>
</form>
</div>