本文整理汇总了PHP中Cms\Classes\Page::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::url方法的具体用法?PHP Page::url怎么用?PHP Page::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cms\Classes\Page
的用法示例。
在下文中一共展示了Page::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRender
/**
*
*/
public function onRender()
{
$urlPage = $this->property('uploadPage');
//$path = Page::url($urlPage, array(), false);
$path = Page::url($urlPage);
$this->page['uploadPage'] = $path;
}
示例2: getUrl
/**
* Returns the URL for the master object of given ID
*
* @param MenuItem $item Master object iD
*
* @return string
*/
public function getUrl(MenuItem $item)
{
$params = [];
if (!empty($item->data['params'])) {
$params = (array) json_decode($item->data['params']);
}
return Pg::url(Pg::find($item->master_object_id)->fileName, $params);
}
示例3: getDetaultPaymentPage
public static function getDetaultPaymentPage($params = [])
{
$settings = self::instance();
if (empty($settings->default_payment_page)) {
return null;
}
return Page::url($settings->default_payment_page, $params);
}
示例4: getUrl
/**
*
* Generates url for the item to be resolved
*
* @param int $year - year number
* @param string $pageCode - page code to be used
* @param $theme
* @return string
*/
protected static function getUrl($year, $pageCode, $theme)
{
$page = CmsPage::loadCached($theme, $pageCode);
if (!$page) {
return '';
}
$properties = $page->getComponentProperties('blogArchive');
if (!isset($properties['yearParam'])) {
return '';
}
$paramName = $properties['yearParam'];
$url = CmsPage::url($page->getBaseFileName(), [$paramName => $year]);
return $url;
}
示例5: fire
/**
* Execute the console command.
* @return void
*/
public function fire()
{
$this->output->writeln('Hello world!');
$crmusers = CRMUser::isNotUpdated()->isHaveEmail()->get();
echo "Processing Users: \n";
$crmusers->each(function ($user) {
$validator = \Validator::make(['email' => $user->email], ['email' => 'email']);
if ($validator->fails()) {
echo $user->email . " not valid email! [-]" . "\n";
} else {
$cmsuser = CMSUser::firstOrNew(['username' => $user->email]);
echo $user->email . " ";
$cmsuser->fill($user->toArray());
if (!$cmsuser->is_activated) {
$pass = str_random(12);
$cmsuser->password = $pass;
$cmsuser->password_confirmation = $pass;
echo ": " . $pass;
}
$user->is_updated = true;
$user->save();
$cmsuser->save();
if (!$cmsuser->is_activated) {
$code = implode('!', [$cmsuser->id, $cmsuser->getActivationCode()]);
$link = Page::url('personal', ['code' => $code]);
$data = ['name' => $cmsuser->name, 'link' => $link, 'code' => $code];
Mail::send('abnmt.mrc::mail.activate', $data, function ($message) use($cmsuser) {
$message->to($cmsuser->email, $cmsuser->name);
});
}
// if (!$cmsuser->is_activated) {
// try { $cmsuser->attemptActivation($cmsuser->activation_code);} catch (\Exception $e) {echo " EXCEPTION!";}
// }
// \Mail::sendTo($this, 'backend::mail.invite', [
// 'name' => $user->name,
// 'email' => 'mrc@abnmt.com',
// 'password' => $pass,
// ]);
echo " [+]\n";
}
});
echo "\n";
$cmsusers = CMSUser::count();
// echo "\n";
// print_r($crmusers);
// echo "\n";
// print_r($cmsusers);
// echo "\n";
}
示例6: onRun
public function onRun()
{
$url = "";
$status = '302';
if ($this->property('redirectInternal') !== null) {
$url = Page::url($this->property('redirectInternal'));
}
if ($this->property('redirectExternal') !== null) {
$url = $this->property('redirectExternal');
}
if ($this->property('statusCode') !== null) {
$status = $this->property('statusCode');
}
if (!!strlen($url)) {
header("Location: " . $url, true, $status);
exit;
}
}
示例7: loadEvents
public function loadEvents()
{
$MyEvents = [];
if ($this->usePermissions) {
$this->loadPermissions();
$query = MyEvents::whereIn('id', CategorysEvents::whereIn('category_id', Category::whereIn('permission_id', $this->permarray)->lists('id'))->lists('event_id'))->whereNotIn('id', CategorysEvents::whereIn('category_id', Category::where('permission_id', Settings::get('deny_perm'))->lists('id'))->lists('event_id'))->published();
} else {
$query = MyEvents::published();
}
$events = $query->past($this->dayspast)->future($this->daysfuture)->orderBy('date')->orderBy('time')->get();
$maxLen = $this->property('title_max', 100);
$linkPage = $this->property('linkpage', '');
foreach ($events as $e) {
$title = strlen($e->text) > 50 ? substr(strip_tags($e->text), 0, $maxLen) . '...' : $e->text;
$link = $e->link ? $e->link : ($linkPage ? Page::url($linkPage, ['slug' => $e->id]) : '#EventDetail"
data-request="onShowEvent"
data-request-data="evid:' . $e->id . '"
data-request-update="\'Events::details\':\'#EventDetail\'" data-toggle="modal" data-target="#myModal');
$MyEvents[$e->year][$e->month][$e->day][] = ['name' => $e->name . ' ' . $e->human_time, 'title' => $title, 'link' => $link, 'id' => $e->id, 'owner' => $e->user_id];
}
return $MyEvents;
}
示例8: onUpdateFromCrm
/**
* Update Courses from CRM
*/
public function onUpdateFromCrm()
{
$crmusers = CRMUser::isNotUpdated()->isHaveEmail()->get();
if (count($crmusers) == 0) {
Flash::info("No Users for Create/Update");
return;
// return ['#flashMessages' => $this->makePartial('message', ['messages' => ['Success']])];
}
$messages = [];
$crmusers->each(function ($user) use(&$messages) {
$validator = \Validator::make(['email' => $user->email], ['email' => 'email']);
if ($validator->fails()) {
$messages[] = "[–] " . $user->email . " not valid email!";
} else {
$cmsuser = User::firstOrNew(['username' => $user->email]);
$cmsuser->fill($user->toArray());
if (!$cmsuser->is_activated) {
$pass = str_random(12);
$cmsuser->password = $pass;
$cmsuser->password_confirmation = $pass;
$messages[] = "[+] " . $user->email . ' ' . $pass ?: '';
} else {
$messages[] = "[^] " . $user->email;
}
$user->is_updated = true;
$user->save();
$cmsuser->save();
if (!$cmsuser->is_activated && is_null($cmsuser->activation_code)) {
$code = implode('!', [$cmsuser->id, $cmsuser->getActivationCode()]);
$link = Page::url('profile/activate', ['code' => $code]);
$data = ['name' => $cmsuser->name, 'link' => $link, 'code' => $code];
Mail::send('abnmt.mrc::mail.activate', $data, function ($message) use($cmsuser) {
$message->to($cmsuser->email, $cmsuser->name);
});
}
}
});
Flash::success("Users is update");
return ['#flashMessages' => $this->makePartial('message', ['messages' => $messages])];
}
示例9: getBlogCategoryRenderUrls
private static function getBlogCategoryRenderUrls($theme, $item, $allcat = false)
{
$page = CmsPage::loadCached($theme, $item->cmsPage);
$result = [];
$categories = Category::lists('slug', 'name');
$pages = [];
if ($item->nesting > 0) {
foreach ($categories as $slug => $name) {
if ($allcat) {
$url = CmsPage::url($page->getBaseFileName(), ['filter' => 'category', 'slug' => $slug], false);
$url = Str::lower($url) . '/';
$pages[] = array('title' => $name, 'url' => $url);
} else {
$category = Category::whereRaw("LOWER(slug) = '{$slug}'")->first();
$categoryPages = Post::filterByCategory($category->id)->get();
$pageUrl = CmsPage::url($page->getBaseFileName(), ['slug' => $slug], false);
$pageUrl = str_replace('/default', '', Str::lower($pageUrl) . '/');
foreach ($categoryPages as $cpage) {
$pages[] = array('title' => $cpage->title, 'url' => Str::lower($pageUrl) . $cpage->slug . '/');
}
}
}
}
return $pages;
}
示例10: getHiddenFields
public function getHiddenFields($host, $invoice)
{
$result = [];
/*
* Billing information
*/
$customerDetails = (object) $invoice->getCustomerDetails();
$result['first_name'] = $customerDetails->first_name;
$result['last_name'] = $customerDetails->last_name;
$result['address1'] = $customerDetails->street_addr;
$result['city'] = $customerDetails->city;
$result['country'] = $customerDetails->country;
$result['state'] = $customerDetails->state;
$result['zip'] = $customerDetails->zip;
$result['night_phone_a'] = $customerDetails->phone;
/*
* Invoice items
*/
$itemIndex = 1;
foreach ($invoice->getLineItemDetails() as $item) {
$item = (object) $item;
$result['item_name_' . $itemIndex] = $item->description;
$result['amount_' . $itemIndex] = round($item->price, 2);
$result['quantity_' . $itemIndex] = $item->quantity;
$itemIndex++;
}
$totals = (object) $invoice->getTotalDetails();
$invoiceId = $invoice->getUniqueId();
$invoiceHash = $invoice->getUniqueHash();
/*
* Payment set up
*/
$result['no_shipping'] = 1;
$result['cmd'] = '_cart';
$result['upload'] = 1;
$result['tax_cart'] = number_format($totals->tax, 2, '.', '');
$result['invoice'] = $invoiceId;
$result['business'] = $host->business_email;
$result['currency_code'] = $totals->currency;
$result['tax'] = number_format($totals->tax, 2, '.', '');
$result['notify_url'] = $this->getIpnUrl() . '/' . $invoiceHash;
$result['return'] = $this->getAutoreturnUrl() . '/' . $invoiceHash;
if ($host->cancel_page) {
$result['cancel_return'] = Page::url($host->cancel_page, ['invoice_id' => $invoiceId, 'invoice_hash' => $invoiceHash]);
}
$result['bn'] = 'October.Responsiv.Pay.Plugin';
$result['charset'] = 'utf-8';
foreach ($result as $key => $value) {
$result[$key] = str_replace("\n", ' ', $value);
}
return $result;
}
示例11: getCategoryPageUrl
/**
* Returns URL of a category page.
*/
protected static function getCategoryPageUrl($pageCode, $category, $theme)
{
$page = CmsPage::loadCached($theme, $pageCode);
if (!$page) {
return;
}
$paramName = 'category';
$url = CmsPage::url($page->getBaseFileName(), [$paramName => $category['slug']]);
return $url;
}
示例12: getConfirmationUrl
protected function getConfirmationUrl($subscriber)
{
$pageName = $this->property('templatePage');
return Page::url($pageName, ['code' => $subscriber->getUniqueCode()]) . '?verify=1';
}
示例13: getCategoryPageUrl
/**
* Returns URL of a category page.
*/
protected static function getCategoryPageUrl($pageCode, $category, $theme)
{
$page = CmsPage::loadCached($theme, $pageCode);
if (!$page) {
return;
}
$properties = $page->getComponentProperties('blogPosts');
if (!isset($properties['categoryFilter'])) {
return;
}
$filter = substr($properties['categoryFilter'], 1);
$url = CmsPage::url($page->getBaseFileName(), [$filter => $category->slug], false);
return Str::lower(RouterHelper::normalizeUrl($url));
}
示例14: getHiddenFields
public function getHiddenFields($host, $invoice)
{
$result = [];
/*
* Billing information
*/
$customerDetails = (object) $invoice->getCustomerDetails();
$result['firstname'] = $customerDetails->first_name;
$result['lastname'] = $customerDetails->last_name;
$result['address'] = $customerDetails->street_addr;
$result['city'] = $customerDetails->city;
$result['country'] = $customerDetails->country;
$result['state'] = $customerDetails->state;
$result['postal_code'] = $customerDetails->zip;
$result['phone_number'] = $customerDetails->phone;
/*
* Invoice items
*/
$itemIndex = 2;
foreach ($invoice->getLineItemDetails() as $item) {
$item = (object) $item;
$result['amount' . $itemIndex . 'description'] = $item->description;
$result['amount' . $itemIndex] = round($item->price, 2);
$itemIndex++;
}
$totals = (object) $invoice->getTotalDetails();
$invoiceId = $invoice->getUniqueId();
$invoiceHash = $invoice->getUniqueHash();
/*
* Payment set up
*/
$result['amount'] = $totals->total;
$result['transaction_id'] = $invoiceId;
$result['pay_to_email'] = $host->business_email;
$result['currency'] = $totals->currency;
$result['language'] = 'EN';
$result['merchant_fields'] = "field1";
$result['field1'] = $invoiceId;
$result['status_url'] = $this->getStatusUrl() . '/' . $invoiceHash;
$result['return_url'] = $this->getReturnUrl() . '/' . $invoiceHash;
if ($host->cancel_page) {
$result['cancel_return'] = Page::url($host->cancel_page, ['invoice_id' => $invoiceId, 'invoice_hash' => $invoiceHash]);
}
$result['bn'] = 'October.Responsiv.Pay.Plugin';
$result['charset'] = 'utf-8';
foreach ($result as $key => $value) {
$result[$key] = str_replace("\n", ' ', $value);
}
return $result;
}
示例15: function
<?php
use Cms\Classes\Page;
use Mohsin\Txt\Models\Robot;
use Mohsin\Txt\Models\Human;
use Mohsin\Txt\Models\Setting;
Route::get('robots.txt', function () {
if (!Setting::get('use_robots') || !Robot::first()) {
return Redirect::to(Page::url(Setting::get('redirectpage')));
}
return Response::make(Robot::first()->generateTxt(), 200, array('Content-Type' => 'text/plain'));
});
Route::get('humans.txt', function () {
if (!Setting::get('use_humans') || !Human::first()) {
return Redirect::to(Page::url(Setting::get('redirectpage')));
}
return Response::make(Human::first()->generateTxt(), 200, array('Content-Type' => 'text/plain'));
});