本文整理汇总了PHP中string::to_url方法的典型用法代码示例。如果您正苦于以下问题:PHP string::to_url方法的具体用法?PHP string::to_url怎么用?PHP string::to_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string
的用法示例。
在下文中一共展示了string::to_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete product
* @param integer id of product
* @return void
*/
public function delete($id)
{
// Check user permission
if (user::is_got()) {
// Settings
$this->set_title(Kohana::lang('eshop.delete_product'));
$this->add_breadcrumb(Kohana::lang('eshop.delete_product'), url::current());
if ($_POST) {
if (isset($_POST['yes'])) {
// clicked on yes = delete
$cat = $this->products->get_product_cat($id);
$cat = $cat[0];
$status = $this->products->delete_data($id);
// Also delte images if deletition was successful
if ($status == TRUE) {
gallery::delete_images($id, 'products');
}
url::redirect('/cat/' . $cat . '/' . cat::get_name($cat));
} else {
url::redirect('/product/' . $id . '/' . string::to_url(product::get_name($id)));
}
}
// page
$this->template->content = new View('admin/product_delete');
} else {
url::redirect('/denied');
}
}
示例2:
echo $row['price'];
?>
,- <?php
echo Kohana::lang('eshop.currency');
?>
</strong>
<div class="cleaner"> </div>
<?php
echo $row['short_description'];
?>
<div class="order-buttons">
<a class="button" href="/product/<?php
echo $row['id'];
?>
/<?php
echo string::to_url($row['name']);
?>
"><?php
echo Kohana::lang('eshop.detail');
?>
</a>
<a class="button" href="/cart/add/<?php
echo $row['id'];
?>
"><?php
echo Kohana::lang('eshop.add_to_cart');
?>
</a>
</div>
</div>
</div>