本文整理汇总了PHP中Catalog::route方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::route方法的具体用法?PHP Catalog::route怎么用?PHP Catalog::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::route方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
/**
* @package Arastta eCommerce
* @copyright Copyright (C) 2015 Arastta Association. All rights reserved. (arastta.org)
* @credits See CREDITS.txt for credits and other copyright notices.
* @license GNU General Public License version 3; see LICENSE.txt
*/
if (version_compare(PHP_VERSION, '5.3.10', '<')) {
die('Your host needs to use PHP 5.3.10 or higher to run Arastta.');
}
define('AREXE', 1);
require_once 'define.php';
// Startup
require_once DIR_SYSTEM . 'library/client.php';
Client::setName('catalog');
require_once DIR_SYSTEM . 'startup.php';
// App
$app = new Catalog();
// Initialise main classes
$app->initialise();
// Load eCommerce classes
$app->ecommerce();
// Route the app
$app->route();
// Dispatch the app
$app->dispatch();
// Render the output
$app->render();
示例2: api
public function api()
{
$this->load->language('sale/order');
$this->document->setTitle($this->language->get('heading_title'));
if ($this->validate() && isset($this->request->get['api'])) {
// Change the client
Client::setName('catalog');
// App
$app = new Catalog();
// Initialise main classes
$app->initialise();
// Include any URL perameters
foreach ($this->request->get as $key => $value) {
if ($key != 'route' && $key != 'token' && $key != 'store_id') {
$app->request->get[$key] = $value;
}
}
$app->request->get['route'] = $this->request->get['api'];
if ($this->request->post) {
$app->request->post = $this->request->post;
}
$app->session->data['api_id'] = $this->config->get('config_api_id');
// Load eCommerce classes
$app->ecommerce();
// Route the app
$app->route();
// Dispatch the app
$app->dispatch();
// Get the output
$json = $app->response->getOutput();
unset($app);
// Return back to admin
Client::setName('admin');
} else {
$response = array();
$response['error'] = $this->error;
unset($this->error);
$json = json_encode($response);
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput($json);
}
示例3: getSeoLink
public function getSeoLink($information_id, $language_code)
{
// Change the client
Client::setName('catalog');
$app = new Catalog();
$app->initialise();
$app->ecommerce();
$app->route();
$site_url = $app->url->link('information/information', 'information_id=' . $information_id . '&lang=' . $language_code, 'SSL');
$admin_folder = str_replace(DIR_ROOT, '', DIR_ADMIN);
$seo_url = str_replace($admin_folder, '', $site_url);
// Return back to admin
Client::setName('admin');
return $seo_url;
}
示例4: pdf
public function pdf($dest = 'D')
{
$url = '';
if (isset($this->request->get['filter_invoice_number'])) {
$url .= '&filter_invoice_number=' . urlencode(html_entity_decode($this->request->get['filter_invoice_number'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_order_id'])) {
$url .= '&filter_order_id=' . $this->request->get['filter_order_id'];
}
if (isset($this->request->get['filter_customer'])) {
$url .= '&filter_customer=' . urlencode(html_entity_decode($this->request->get['filter_customer'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_total'])) {
$url .= '&filter_total=' . $this->request->get['filter_total'];
}
if (isset($this->request->get['filter_invoice_date'])) {
$url .= '&filter_invoice_date=' . $this->request->get['filter_invoice_date'];
}
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
if (!$this->validate()) {
$this->response->redirect($this->url->link('sale/invoice', 'token=' . $this->session->data['token'] . $url, 'SSL'));
}
$this->load->language('sale/order');
$this->load->language('sale/invoice');
$this->load->model('sale/order');
$this->load->model('sale/invoice');
if (isset($this->request->get['invoice_id'])) {
$invoice_id = $this->request->get['invoice_id'];
} else {
$invoice_id = 0;
}
$invoice_info = $this->model_sale_invoice->getInvoice($invoice_id);
if (!$invoice_info) {
$this->session->data['error'] = $this->language->get('error_invoice_not_found');
$this->response->redirect($this->url->link('sale/invoice', 'token=' . $this->session->data['token'] . $url, 'SSL'));
}
Client::setName('catalog');
$app = new Catalog();
$app->initialise();
$app->request->get['route'] = 'account/order/invoice';
$app->request->get['order_id'] = $invoice_info['order_id'];
$app->request->get['dest'] = $dest;
$app->request->post = array();
$app->ecommerce();
$app->route();
$app->dispatch();
unset($app);
// Return back to admin
Client::setName('admin');
}