本文整理汇总了PHP中category::category方法的典型用法代码示例。如果您正苦于以下问题:PHP category::category方法的具体用法?PHP category::category怎么用?PHP category::category使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::category方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: category
</tr>
<tr>
<td></td>
<td id="submit"><input type="submit" name="Add" value="Add" ></td>
</tr>
</table>
</form>
<br/>
<br/>
<table class="table table-bordered table-hover table-striped table-responsive">
<tr><th colspan="3"><h2>All categories</h2></th></tr>
<?php
$categ = new category();
$c = $categ->category();
foreach ($c as $key => $value) {
$name = $value['name'];
?>
<tr>
<td><?php
echo $name;
?>
</td>
<td><a href="editcategory.php?id=<?php
echo $value['tid'];
?>
">edit</a></td>
<td><a href="removecategory.php?id=<?php
echo $value['tid'];
?>
示例2: category
<?php
include 'categoryclass.php';
include 'subcategoryclass.php';
$cat = new category();
$c = $cat->category();
if (isset($_POST['Add'])) {
if (!empty(trim($_POST['subcatname']))) {
$subcat = new subcategory();
$Type_id = $_POST['catname'];
$scatname = $_POST['subcatname'];
$subcat->insert($scatname, $Type_id);
}
}
include 'header1.php';
?>
<form action="addSubcategory.php" method="post">
<div id="inside">
<div class="container">
<div class="row">
<table class="table table-bordered table-hover table-striped table-responsive">
<tr><th colspan="2"><h2>Add new subcategory</h2></th></tr>
<tr>
<th>category name</th>
<td><select name="catname">
<?php
foreach ($c as $key => $value) {
$cat_id = $value['tid'];
$name = $value['name'];
echo "<option value='{$cat_id}'>{$name}</option> ";