本文整理匯總了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>";