本文整理汇总了PHP中Uri::Instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::Instance方法的具体用法?PHP Uri::Instance怎么用?PHP Uri::Instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uri
的用法示例。
在下文中一共展示了Uri::Instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
public function __toString()
{
/**
* poa = product options atributes
*/
$update_fields = array();
$db = Database::Instance();
$uri = Uri::Instance();
$string = null;
$tienda_id = (int) $uri->segment("edit");
if (request::method() == 'post' and is_array(@$_POST['igallery_h'])) {
$db->query("DELETE FROM product_images where product_id_product = {$tienda_id}");
$ic = 0;
if (@$_FILES['igallery'] != "") {
$arrf = $this->reArrayFiles($_FILES['igallery']);
}
foreach ($_POST['igallery_h'] as $value) {
// echo Kohana::debug($value);
// echo Kohana::debug($arrf[$ic]);
if (@$arrf[$ic]['name'] != "") {
$value = $this->upimg($arrf[$ic]);
}
// echo Kohana::debug($value);
// echo "INSERT INTO product_images (product_id_product ,pi_image) VALUES ('$tienda_id','$value')";
if ($value != "") {
try {
$db->query("INSERT INTO product_images (product_id_product ,pi_image) VALUES ('{$tienda_id}','{$value}')");
} catch (Exception $e) {
echo Kohana::debug('Error: ' . "\n" . $e->getMessage() . "\n");
}
}
$ic++;
}
}
try {
$r = $db->query("SELECT * FROM product_images WHERE product_id_product = {$tienda_id}");
$string = View::factory("extras/galleryimage")->set("imgs", $r)->render();
} catch (Exception $e) {
echo Kohana::debug('Error: ' . "\n" . $e->getMessage() . "\n");
}
return $string;
}
示例2: GalleryImage
public static function GalleryImage()
{
$uri = Uri::Instance();
$id = (int) $uri->segment('id');
$db = Database::Instance();
$r = $db->query("SELECT * FROM product_images WHERE product_id_product = {$id}");
$str = null;
$ct = 0;
foreach ($r as $row) {
$str .= '
<a rel="prettyPhoto[grp]" id="imggal_' . $ct . '" href="' . basics::upload() . $row->pi_image . '" class="gallery" >a
</a>';
$ct++;
}
return $str;
}
示例3: GetSchemaCategory_SelDisplay
public static function GetSchemaCategory_SelDisplay()
{
$initlevel = 1;
$html = null;
$new_array = array();
$table = new fpp_category_Model();
$orm = $table->db2cls();
$orm->limit = null;
$checksub = true;
$uri = Uri::Instance();
$itemid = (int) $uri->segment("items");
$rl1 = $orm->fetch_where(array('enable' => '1'), array('cat_id' => 'ASC', 'order_cat' => 'DESC'));
foreach ($rl1 as $row) {
if ($row->cat_id == $initlevel) {
$new_array[$row->id_category] = $row;
$new_array[$row->id_category]->sub = array();
} else {
$nnew_array[$row->id_category] = $row;
$nnew_array2[$row->cat_id][] = $row;
if ($row->cat_id == $itemid) {
$new_array[$itemid]->sub[] = $row;
$checksub = false;
}
}
}
if ($checksub and @$nnew_array[$itemid]->cat_id != "") {
$cidn12 = $nnew_array[$itemid]->cat_id;
$arraycid = $nnew_array2[$cidn12];
$new_array[$cidn12]->sub = $arraycid;
}
foreach ($new_array as $row) {
$name_category = Basic::TransVar("name_category");
$href = html::anchor("category/items/" . @$row->id_category, @$row->{$name_category});
$img = $row->image_category != "" ? html::image(basics::upload() . $row->image_category) : null;
if (!(@$row->id_category == '')) {
$html .= "<li class='supcat'>{$img} {$href}</li>";
foreach ($row->sub as $sub) {
$href = html::anchor("category/items/" . $sub->id_category, $sub->{$name_category});
$html .= "<li class='subcat'>{$href}</li>";
}
// $html .= "</ul>";
}
}
// echo Kohana::debug($new_array);
return $html;
}