本文整理汇总了PHP中Projects::get_categories方法的典型用法代码示例。如果您正苦于以下问题:PHP Projects::get_categories方法的具体用法?PHP Projects::get_categories怎么用?PHP Projects::get_categories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projects
的用法示例。
在下文中一共展示了Projects::get_categories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Projects
<input type="file" name="bg_file" id="bg_file" />
</div>
<div class="form-group">
<label for="text">Vertical Image:</label>
<input type="file" name="file" id="file" />
</div>
<div class="form-group">
<label for="text">Category:</label>
<select class="selectpicker" id="cat_id" name="cat_id" data-style="btn-primary">
<?php
$p = new Projects('member', BASE_DOMAIN);
$cats = $p->get_categories();
for ($x = 0; $x < count($cats); $x++) {
$cats_name = $cats[$x]['name'];
$cats_uid = $cats[$x]['id'];
?>
<option value="<?php
echo $cats_uid;
?>
"><?php
echo $cats_name;
?>
</option>
<?php
示例2: Projects
<th>Category Name</th>
<th>Slug</th>
<th>Icon</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
require_once "../config.inc.php";
$db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->connect();
$r = new Projects('unknown', BASE_DOMAIN);
$categories = $r->get_categories();
//print_r($projects);
for ($i = 0; $i < count($categories); $i++) {
$id = $categories[$i]['id'];
$name = $categories[$i]['name'];
$icon = $categories[$i]['icon'];
$slug = $categories[$i]['slug'];
echo "<tr id=\"cat_" . $id . "\">";
// next field client_id
//not editable
echo "<td>";
echo $id;
echo "</td>";
//next field name
echo "<td>";
echo "<style>\n #name_" . $id . ":hover { background: #fffbe1; }\n </style>";