当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::url方法代码示例

本文整理汇总了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;
 }
开发者ID:keiosweb,项目名称:oc-support-plugin,代码行数:10,代码来源:TicketStatus.php

示例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);
 }
开发者ID:janusnic,项目名称:OctoberCMS,代码行数:15,代码来源:Page.php

示例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);
 }
开发者ID:dogiedog,项目名称:pay-plugin,代码行数:8,代码来源:Settings.php

示例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;
 }
开发者ID:graker,项目名称:blogarchive,代码行数:23,代码来源:SitemapProvider.php

示例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";
 }
开发者ID:abnmt,项目名称:oc-mrc-plugin,代码行数:53,代码来源:SyncUsers.php

示例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;
     }
 }
开发者ID:junksdesign,项目名称:stanfour4,代码行数:18,代码来源:RedirectComponent.php

示例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;
 }
开发者ID:ardani,项目名称:MyCalendar,代码行数:22,代码来源:Events.php

示例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])];
 }
开发者ID:abnmt,项目名称:oc-mrc-plugin,代码行数:43,代码来源:Users.php

示例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;
 }
开发者ID:betes-curieuses-design,项目名称:AllianceEducation,代码行数:25,代码来源:Category.php

示例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;
 }
开发者ID:chesterx,项目名称:pay-plugin,代码行数:52,代码来源:PaypalStandard.php

示例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;
 }
开发者ID:chrisvidal,项目名称:oc-theater-plugin,代码行数:13,代码来源:Performance.php

示例12: getConfirmationUrl

 protected function getConfirmationUrl($subscriber)
 {
     $pageName = $this->property('templatePage');
     return Page::url($pageName, ['code' => $subscriber->getUniqueCode()]) . '?verify=1';
 }
开发者ID:aydancoskun,项目名称:octobercms,代码行数:5,代码来源:Signup.php

示例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));
 }
开发者ID:janusnic,项目名称:OctoberCMS,代码行数:17,代码来源:Category.php

示例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;
 }
开发者ID:chesterx,项目名称:pay-plugin,代码行数:50,代码来源:Skrill.php

示例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'));
});
开发者ID:Danielberry90,项目名称:Txt,代码行数:18,代码来源:routes.php


注:本文中的Cms\Classes\Page::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。