本文整理汇总了PHP中Url::link方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::link方法的具体用法?PHP Url::link怎么用?PHP Url::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($mid = 1)
{
$vendorlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Subregion");
$datum = $this->model->getList("", "subregion");
$this->view->mysubregion = $datum['subregion'];
$uri = new Url("");
$vendorlist .= "<table width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Area ID</th><th> Name </th><th>Description </th><th>Date Created </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
if ($this->view->mysubregion) {
$x = 1;
foreach ($this->view->mysubregion as $region) {
$vendorlist .= "<tr>\n \t<td>{$x}</td><td>{$region->id}</td><td>{$region->name} </td><td>{$region->des}</td><td>{$region->datecreated}</td><td>{$region->datemodified}</td><td><a href='" . $uri->link("subregion/edit/" . $region->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("subregion/doDelete/" . $region->id . "") . "'>Delete</a></td>\n </tr>";
$x++;
}
} else {
$vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$vendorlist .= "</tbody>\n</table>";
$this->view->myvends = $vendorlist;
$this->view->render("subregion/index");
}
示例2: index
public function index($mid = 1)
{
$vendorlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Vendors");
$datum = $this->model->getList("", "Vendors");
$this->view->myvendors = $datum['vendors'];
$uri = new Url("");
$vendorlist .= "<table width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Vendor ID</th><th>Vendor Name </th><th>Email </th><th>Telephone </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
if ($this->view->myvendors) {
$x = 1;
foreach ($this->view->myvendors as $vendor) {
$vendorlist .= "<tr>\n \t<td>{$x}</td><td>{$vendor->vend_id}</td><td>{$vendor->vend_name} </td><td>{$vendor->vend_email}</td><td>{$vendor->vend_phone}</td><td>{$vendor->vend_datemodified}</td><td><a href='" . $uri->link("vendors/edit/" . $vendor->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("vendors/doDelete/" . $vendor->id . "") . "'>Delete</a></td>\n </tr>";
$x++;
}
} else {
$vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$vendorlist .= "</tbody>\n</table>";
$this->view->myvends = $vendorlist;
$this->view->render("vendors/index");
}
示例3: index
public function index($mid = 1)
{
$itemlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Stockitems");
$datum = $this->model->getList("", "Stockitems");
$this->view->myitems = $datum['items'];
$uri = new Url("");
$itemlist .= "<table width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Item ID</th><th>Item Name </th><th>Description </th><th>Qty In Stock </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
if ($this->view->myitems) {
$x = 1;
foreach ($this->view->myitems as $item) {
$itemlist .= "<tr>\n \t<td>{$x}</td><td>{$item->item_id}</td><td>{$item->item_name} </td><td>{$item->item_description}</td><td>{$item->item_quantity}</td><td>{$item->item_datemodified}</td><td><a href='" . $uri->link("stockitems/edit/" . $item->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("stockitems/doDelete/" . $item->id . "") . "'>Delete</a></td>\n </tr>";
$x++;
}
} else {
$itemlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$itemlist .= "</tbody>\n</table>";
$this->view->myitems = $itemlist;
$this->view->render("stockitems/index");
}
示例4: index
public function index($mid = 1)
{
$productlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Clientproduct");
$datum = $this->model->getList("", "Clientproduct");
$this->view->myclientsproducts = $datum['clientproduct'];
$uri = new Url("");
$productlist .= "<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Product </th><th>Client</th><th>Location</th><th>City </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>";
if ($this->view->myclientsproducts) {
$x = 1;
foreach ($this->view->myclientsproducts as $products) {
$productlist .= "<tr>\n \t<td>{$x}</td><td><a href='" . $uri->link("clientproduct/detail/" . $products->id) . "'>{$products->prod_name}</a> </td><td>{$products->client_name}</td><td>{$products->install_address}</td><td>{$products->install_city}</td><td><a href='" . $uri->link("clientproduct/edit/" . $products->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("clientproduct/doDelete/" . $products->id . "") . "'>Delete</a></td>\n </tr>";
$x++;
}
} else {
$productlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$productlist .= "</tbody>\n </table>";
$this->view->myprods = $productlist;
$this->view->render("clientproduct/index");
}
示例5: index
public function index($mid = 1)
{
$productlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Clientproduct");
$datum = $this->model->getList("", "Clientproduct");
$this->view->myclientsproducts = $datum['clientproduct'];
global $session;
$uri = new Url("");
$productlist .= "<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Product </th><th>Client</th><th>Location</th><th>City </th><th></th><th></th>";
/**
* check for priviledge
* for logged in users
* at table level
*/
$productlist .= "</tr>\n </thead>\n <tbody>";
if ($this->view->myclientsproducts) {
$x = 1;
foreach ($this->view->myclientsproducts as $products) {
$productlist .= "<tr>\n \t<td>{$x}</td><td><a href='" . $uri->link("clientproduct/detail/" . $products->id) . "'>{$products->prod_name}</a> </td><td>{$products->client_name}</td><td>{$products->install_address}</td><td>{$products->install_city}</td>";
foreach ($session->employee_role as $erole) {
//$emodule = Modules::find_by_module($erole->module);
$grant = array();
$grant = explode(",", $erole->access);
if ($erole->module == "clientproduct") {
if (in_array("Modify", $grant)) {
$productlist .= "<td><a href='" . $uri->link("clientproduct/edit/" . $products->id . "") . "'>Edit</a></td>";
} else {
$productlist .= "<td>";
print_r($grant);
$productlist .= "</td>";
}
if (in_array("Modify", $grant)) {
$productlist .= "<td><a href='" . $uri->link("clientproduct/doDelete/" . $products->id . "") . "'>Delete</a></td>";
} else {
$productlist .= "<td></td>";
}
}
}
$productlist .= "</tr>";
$x++;
}
} else {
$productlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$productlist .= "</tbody>\n </table>";
$this->view->myprods = $productlist;
$this->view->render("clientproduct/index");
}
示例6: index
public function index($mid = 1)
{
$vendorlist = "";
if (empty($mid)) {
redirect_to($this->uri->link("error/index"));
exit;
}
$this->loadModel("Products");
$datum = $this->model->getList("", "products");
$this->view->myproducts = $datum['products'];
$uri = new Url("");
$vendorlist .= "<div class='row'><div class='large-12 columns'>" . $datum['mypagin'];
$vendorlist .= "</div></div><div class='row'><div class='large-12 columns'><table width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>ProdID</th><th> Name </th><th>Description </th><th>Date Created </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
if ($this->view->myproducts) {
$x = 1;
foreach ($this->view->myproducts as $region) {
$vendorlist .= "<tr>\n \t<td>{$x}</td><td>{$region->prod_id}</td><td>{$region->prod_name} </td><td>{$region->prod_desc}</td><td>{$region->prod_created}</td><td>{$region->Prod_modified}</td><td><a href='" . $uri->link("products/edit/" . $region->prod_id . "") . "'>Edit</a></td><td><a class='dataDelete' data-reveal-id='firstModal{$region->prod_id}' href='#'>Delete</a>\n \n \n <div id='firstModal{$region->prod_id}' class='reveal-modal small' style='background-image: linear-gradient(0deg, #f2f9fc, #addcf0 20.0em); border-radius:5px'>\n <h2>Data Delete Console.</h2>\n <hr />\n <p>You are about to delete a record. Any record deleted will not longer be available in the database <br /> Are you sure you want to delete <b>{$region->prod_name}</b> from the database?</p>\n <p><a href='?url=products/doCheckTransLog/{$region->main_id}' data-reveal-id='secondModal{$region->prod_id}' class='btn button btn-danger' data-reveal-ajax='true'>Yes</a> <a pdid='{$region->prod_id}' class='btn button btn-danger modalclose'>No</a></p>\n <a class='close-reveal-modal'>×</a>\n </div>\n\n <div id='secondModal{$region->prod_id}' class='reveal-modal small' style='background-image: linear-gradient(0deg, #f2f9fc, #addcf0 20.0em); border-radius:5px'>\n <h2>This is a second modal.</h2>\n <hr />\n <p></p>\n <a class='close-reveal-modal closemodal'>×</a>\n </div>\n \n \n \n </td>\n </tr>";
$x++;
}
} else {
$vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
}
$vendorlist .= "</tbody>\n</table></div></div><div class='row'><div class='large-12 columns'>";
$vendorlist .= $datum['mypagin'] . "</div><p> </p></div>";
$this->view->myvends = $vendorlist;
$this->view->render("products/index");
}
示例7: __construct
/**
* Constructor
*
* @param string $template
*/
public function __construct($name, $template = NULL, $base_uri = NULL)
{
parent::__construct($name);
cogear()->menu->register($name, $this);
$template && ($this->template = $template);
$this->base_uri = rtrim(parse_url($base_uri ? $base_uri : Url::link(), PHP_URL_PATH), '/') . '/';
}
示例8: render
/**
* Render
*/
public function render()
{
$this->getAttributes();
if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
$tpl = new Template('Form.file');
$tpl->assign($this->attributes);
$tpl->value = $this->value;
$this->code = $tpl->render();
}
return parent::render();
}
示例9: render
/**
* Render
*/
public function render()
{
$this->getAttributes();
$this->attributes->type = 'file';
$this->attributes->class = 'ajaxed image';
$tpl = new Template('Upload_Ajax.image');
$tpl->assign($this->attributes);
if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
$tpl->value = $this->value;
$tpl->image = $this->image;
}
$this->code = $tpl->render();
return Form_Element_Abstract::render();
}
示例10: __construct
/**
* Конструктор
*
* @param array $options
*/
public function __construct($options)
{
// Принимаем настройки
parent::__construct($options);
// Подкрепляем шестеренку Мета в качестве слушателя Listener (паттерн ООП Observer)
$this->attach(cogear()->Meta);
// Определяем базовый uri, от которого работает меню
$this->options->base = rtrim(parse_url($this->options->base ? $this->options->base : Url::link(), PHP_URL_PATH), '/') . '/';
// Если определен вывод, вешаем хук
$this->options->render && hook($this->options->render, array($this, 'output'));
// Регистрируем элементы меню из конфига
if ($this->options->elements) {
foreach ($this->options->elements as $item) {
$this->add($item->toArray());
}
}
}
示例11: admin
public function admin($action = NULL)
{
if ($files = glob($this->dir . DS . 'js/jquery*')) {
$current_script = reset($files);
preg_match('#jquery-([\\d.]+)(\\.min)?\\.js#', $current_script, $matches);
$current_version = $matches[1];
$code = file_get_contents('http://code.jquery.com/');
preg_match('#/jquery-([\\d\\.]+)\\.min\\.js#imsU', $code, $matches);
$server_script = 'http://code.jquery.com' . $matches[0];
$server_version = $matches[1];
if (version_compare($server_version, $current_version, '>')) {
if ($action = 'update') {
Filesystem::delete($current_script);
copy($server_script, dirname($current_script) . DS . basename($server_script));
success(t('jQuery library has been update successfully!'));
} else {
info(t("Notice, jQuery framework has been updated to version <b>%s</b>. Current version is <b>%s</b>.", 'jQuery', $server_version, $current_version) . '<a href="' . Url::link('admin/jquery/update/') . '" class="button">' . t('Update') . '</a>');
}
}
}
}
示例12: index
public function index()
{
@$this->loadModel("Users");
$uri = new Url("");
$datum = array();
$datum = $this->model->getList("", "users");
$this->view->pagin = $datum['mypagin'];
$this->alluser = $datum['myusers'];
$userlist = "";
$userlist .= "<table width='100%' class='table table-bordered'>\n\t\t<thead><tr>\n\t\t\t<th>ID</th><th>Image</th><th>Fullname</th><th>Email</th><th>Telephone</th><th>Date Created</th><th>Last Modified</th><th></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>";
if ($this->alluser) {
foreach ($this->alluser as $user) {
$userlist .= "<tr>\n\t\t\t<td>{$user->user_id}</td><td>";
$userlist .= $user->img_url != "" && file_exists("public/uploads/{$user->img_url}") ? "<img src ='public/uploads/{$user->img_url}' width='50' height='48' />" : "<img src ='public/images/anonymous.jpg' width='50' height='48' />";
$userlist .= "</td><td>{$user->fname} {$user->lname}</td><td>{$user->email}</td><td>{$user->phone}</td><td>{$user->date_added}</td><td>{$user->date_added}</td><td><a href='" . $uri->link("users/edit/" . $user->user_id . "") . "'>Edit</a></td>\n\t\t</tr>";
}
} else {
$userlist .= "<tr><td colspan='10'> No record found </td></tr>";
}
$userlist .= "</tbody></table>";
$this->view->myusers = $userlist;
$this->view->render("users/index");
}
示例13: zmenu_autocomplete
public function zmenu_autocomplete()
{
$furl = new Url("/", "/");
$json = array();
if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_model'])) {
$this->load->model('catalog/product');
if (isset($this->request->get['filter_name'])) {
$filter_name = $this->request->get['filter_name'];
} else {
$filter_name = '';
}
if (isset($this->request->get['filter_model'])) {
$filter_model = $this->request->get['filter_model'];
} else {
$filter_model = '';
}
if (isset($this->request->get['limit'])) {
$limit = $this->request->get['limit'];
} else {
$limit = 20;
}
$data = array('filter_name' => $filter_name, 'filter_model' => $filter_model, 'start' => 0, 'limit' => $limit);
$results = $this->model_catalog_product->getProducts($data);
foreach ($results as $result) {
$titles = $this->model_catalog_product->getProductDescriptions($result['product_id']);
$json[] = array('product_id' => $result['product_id'], 'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 'model' => $result['model'], 'price' => $result['price'], 'titles' => $titles, 'href' => $furl->link('product/product', 'path=' . $result['product_id'], 'SSL'));
}
}
$this->response->setOutput(json_encode($json));
}
示例14: search
public function search()
{
$this->loadModel("Supportticket");
$datum = $this->model->search();
$this->view->mytickets = $datum['Supportticket'];
$uri = new Url("");
$ticketlist .= "<table class='table table-bordered'>\n\t\t\t<thead><tr>\n\t\t\t\t<th width='15%'>Date Created</th><th width='10%'>Ticket ID</th><th width='40%'>Subject</th><th width='5%'>Status </th><th width='10%'>Department </th><th width='10%'>Last Reply</th><th width='10%'></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>";
if ($this->view->mytickets) {
$x = 1;
foreach ($this->view->mytickets as $ticket) {
$ticketlist .= "<tr>\n\t\t\t\t\t<td>" . date_format(new DateTime($ticket->datecreated), "M d Y g:ia") . "</td><td>{$ticket->id}</td><td>{$ticket->subject} </td><td>{$ticket->status}</td><td>{$ticket->department}</td><td>" . date_format(new DateTime($ticket->datemodified), "M d Y g:ia") . "</td><td><a href='" . $uri->link("supportticket/detail/" . $ticket->id . "") . "'>View Ticket</a></td>\n\t\t\t\t</tr>";
$x++;
}
} else {
$ticketlist .= "<tr><td colspan='7'>No Result Found</td></tr>";
}
$ticketlist .= "</tbody>\n\t\t\t</table>";
$this->view->myvends = $ticketlist;
$this->view->render("supportticket/index");
}
示例15: link
/**
* Generate select with links to category, product, information
* @return string Generated <select> html
*/
public function link()
{
$data = array();
$url = new Url(HTTP_CATALOG, $this->registry->config->get('config_secure') ? HTTPS_CATALOG : HTTP_CATALOG);
foreach ($this->getElementModels() as $model) {
switch (true) {
case $model == 'category':
$this->registry->load->model('catalog/category');
$categories = $this->registry->model_catalog_category->getCategories();
foreach ($categories as $category) {
$link = $url->link('product/category', 'path=' . $category['category_id']);
$data['category'][$link] = $category['name'];
}
break;
case $model == 'product':
$this->registry->load->model('catalog/product');
$products = $this->registry->model_catalog_product->getProducts();
foreach ($products as $product) {
$link = $url->link('product/product', 'product_id=' . $product['product_id']);
$data['product'][$link] = $product['name'];
}
break;
case $model == 'information':
$this->registry->load->model('catalog/information');
$informations = $this->registry->model_catalog_information->getInformations();
foreach ($informations as $information) {
$link = $url->link('information/information', 'information_id=' . $information['information_id']);
$data['information'][$link] = $information['title'];
}
break;
case $model == 'custom':
foreach ($this->getElementCustomLinks() as $link => $title) {
$link = $url->link($link);
$data['custom'][$link] = $title;
}
break;
}
}
$this->setElementOptGroups($data);
return $this->select();
}