本文整理汇总了PHP中Categorie::getListeCategorie方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::getListeCategorie方法的具体用法?PHP Categorie::getListeCategorie怎么用?PHP Categorie::getListeCategorie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::getListeCategorie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
" method="post">
<div class="form-group">
<label class="control-label col-sm-3" for="titre">Titre:</label>
<div class="col-sm-7">
<input type="text" class="form-control" name="titre" placeholder="Titre du film..." required value="<?php
echo $film['title'];
?>
" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="categorie">Catégorie:</label>
<div class="col-sm-7">
<select class="form-control" name="categorie" required>
<?php
$categories = Categorie::getListeCategorie();
foreach ($categories as $cat) {
if ($film['categorie'] == $cat['nom']) {
echo "<option selected value='" . $cat['nom'] . "'>" . $cat['nom'] . "</option>";
} else {
echo "<option value='" . $cat['nom'] . "'>" . $cat['nom'] . "</option>";
}
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="realisateurs">Réalisateur(s):</label>
<div class="col-sm-7">
<input type="text" class="form-control" name="realisateurs" placeholder="Réalisateur(s) du film..." required value="<?php
示例2:
<?php
$path = "";
require $path . "includes/session.php";
require $path . "Modele/Film.class.php";
require $path . "Modele/Categorie.class.php";
?>
<html>
<?php
require $path . "includes/header.php";
?>
<body>
<?php
require $path . "includes/navbar.php";
$listeCategorie = Categorie::getListeCategorie();
?>
<div class="container">
<div class="jumbotron">
<div class="filtre">
<a class="btn btn-primary" href="index.php">FILTRE</a>
<?php
foreach ($listeCategorie as $categorie) {
if (isset($_GET['filtres'])) {
if ($_GET['filtres'] == $categorie['nom']) {
?>
<input type="radio" checked onclick="<?php
echo "window.location.href='index.php?filtres=" . $categorie['nom'] . "'";
?>
">