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


PHP Url::site方法代码示例

本文整理汇总了PHP中Url::site方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::site方法的具体用法?PHP Url::site怎么用?PHP Url::site使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Url的用法示例。


在下文中一共展示了Url::site方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($scope)
 {
     $this->_scope = $scope;
     $this->_ckey = self::DEF_CKEY;
     $this->_csecret = self::DEF_CSECRET;
     $this->_req_token_callback = Url::site('/oauth/reqtoken/', true);
 }
开发者ID:hkilter,项目名称:OpenSupplyChains,代码行数:7,代码来源:oauth.php

示例2: render

 public function render()
 {
     $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('lecture', $lecture)->bind('user', $user)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     if ($this->action == 'add') {
         $lecture = ORM::factory('lecture', $this->respective_id);
         if ($this->check_deleted($lecture)) {
             return View::factory('feed/unavaliable')->render();
         }
     } else {
         if ($this->action == 'canceled') {
             $lecture = Model_Lecture::get_lecture_from_event($this->respective_id);
             $event = ORM::factory('event', $this->respective_id);
             if ($this->check_deleted($lecture)) {
                 return View::factory('feed/unavaliable')->render();
             }
             $view->bind('event', $event);
         }
     }
     $user = ORM::factory('user', $this->actor_id);
     $span = Date::fuzzy_span($this->time);
     $feed_id = $this->id;
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $url = Url::site('profile/view/id/');
     return $view->render();
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:29,代码来源:lecture.php

示例3: render

 public function render()
 {
     $span = Date::fuzzy_span($this->time);
     $feed_id = $this->id;
     $comment = ORM::factory('feedcomment');
     $comment->where('feed_id', '=', $feed_id)->order_by('date', 'DESC');
     $comments = $comment->find_all();
     $curr_user = Auth::instance()->get_user();
     $role = $curr_user->role()->name;
     $url = Url::site('profile/view/id/');
     if ($this->action == "publish_result") {
         $examgroup = ORM::factory('examgroup', $this->respective_id);
         if ($this->check_deleted($examgroup)) {
             return View::factory('feed/unavaliable')->render();
         }
         $percent = $examgroup->get_ExamGroupPercent();
         $user = ORM::factory('user', $this->actor_id);
         $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('user', $user)->bind('percent', $percent)->bind('id', $this->respective_id)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     } else {
         $exam = ORM::factory('exam', $this->respective_id);
         if ($this->check_deleted($exam)) {
             return View::factory('feed/unavaliable')->render();
         }
         $user = ORM::factory('user', $this->actor_id);
         $event = ORM::factory('event', $exam->event_id);
         $view = View::factory('feed/' . $this->type . '_' . $this->action)->bind('exam', $exam)->bind('user', $user)->bind('event', $event)->bind('span', $span)->bind('role', $role)->bind('feed_id', $feed_id)->bind('comments', $comments)->bind('url', $url);
     }
     return $view->render();
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:29,代码来源:exam.php

示例4: action_view

 public function action_view()
 {
     $user_id = $this->request->param('id');
     $user = ORM::factory('user', $user_id);
     DynamicMenu::extend(array('profilemenu' => array(array('profile/view/id/' . $user_id, 'Info', 1, array()), array('profile/view/id/' . $user_id, 'Wall', 2, array()))));
     $view = View::factory('profile/view')->bind('user', $user);
     Breadcrumbs::add(array('Profile', Url::site('profile/view/id/' . $user_id)));
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:9,代码来源:profile.php

示例5: toLink

 /**
  * Method to return an anchor tag with room_name as the text and 
  * link to the room as href
  */
 public function toLink()
 {
     if (Acl::instance()->is_allowed('exam_edit')) {
         $url = Url::site('room/edit/id/' . $this->id);
         return Html::anchor($url, (string) $this);
     } else {
         return Html::anchor('#', (string) $this, array('onclick' => 'javascript:KODELEARN.modules.get("rooms").showMap("' . $this->id . '");return false;'));
     }
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:13,代码来源:room.php

示例6: breadcrumbs

 protected function breadcrumbs()
 {
     parent::breadcrumbs();
     $course = ORM::factory('course', Session::instance()->get('course_id'));
     if (!$this->request->is_ajax() && $this->request->is_initial()) {
         Breadcrumbs::add(array('Courses', Url::site('course')));
         Breadcrumbs::add(array(sprintf($course->name), Url::site('course/summary/id/' . $course->id)));
         Breadcrumbs::add(array('Exercises', Url::site('exercise')));
     }
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:10,代码来源:exercise.php

示例7: action_index

 public function action_index()
 {
     $feeds = Request::factory('feed/feeds')->method(Request::GET)->execute()->body();
     $post_form = Request::factory('post/form')->execute()->body();
     $total_feeds = Model_Feed::get_total_feeds();
     $view = View::factory('feed/index')->bind('feeds', $feeds)->bind('post_form', $post_form)->bind('total_feeds', $total_feeds);
     if ($this->request->is_initial()) {
         Breadcrumbs::add(array('Feeds', Url::site('feed')));
     }
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:11,代码来源:feed.php

示例8: delete

 public function delete()
 {
     $url = Registry::getUrl();
     $id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
     $tipo = new Tipo($id);
     if ($tipo->id) {
         if ($tipo->delete()) {
             Registry::addMessage("Tipo de entrada eliminado satisfactoriamente", "success");
         }
     }
     Url::redirect(Url::site("tipos"));
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:12,代码来源:tipos.php

示例9: delete

 public function delete()
 {
     $url = Registry::getUrl();
     $id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
     $user = new User($id);
     if ($user->id) {
         if ($user->delete()) {
             Registry::addMessage("Usuario eliminado satisfactoriamente", "success");
         }
     }
     Url::redirect(Url::site("users"));
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:12,代码来源:users.php

示例10: action_index

 public function action_index()
 {
     $submitted = false;
     $view = View::factory('system/form')->bind('form', $form)->bind('image', $image)->bind('success', $success)->bind('upload_url', $upload_url)->bind('permission_msg', $permission_msg);
     $institution = ORM::factory('institution', $id = 1);
     $config = Config::instance();
     $config_settings = $config->load('config')->as_array();
     $permission_msg = '';
     // if post, validate, save and redirect
     if ($this->request->method() === 'POST' && $this->request->post()) {
         if (Acl::instance()->is_allowed('system_edit')) {
             $submitted = true;
             $config_post = $this->request->post('config');
             if (isset($config_post['membership'])) {
                 $config_post['membership'];
             } else {
                 $config_post['membership'] = 0;
             }
             if (isset($config_post['user_approval'])) {
                 $config_post['user_approval'];
             } else {
                 $config_post['user_approval'] = 0;
             }
             //echo $config_post['membership'];
             //exit;
             $validator = $institution->validator($this->request->post());
             if ($validator->check()) {
                 $institution->name = $this->request->post('name');
                 $institution->institution_type_id = $this->request->post('institutiontype_id');
                 $institution->logo = $this->request->post('logo');
                 $institution->website = $this->request->post('website');
                 $institution->address = $this->request->post('address');
                 $institution->save();
                 $config->load('config')->setMany($config_post);
                 Session::instance()->set('success', 'Setting saved successfully.');
                 Request::current()->redirect('system');
                 exit;
             } else {
                 $this->_errors = $validator->errors('institution');
             }
         } else {
             $permission_msg = '<div class="formMessages"><span class="fmIcon bad"></span> <span class="fmText">Permission denied for editing this page.</span><span class="clear">&nbsp;</span></div>';
         }
     }
     $upload_url = URL::site('system/uploadinst');
     $images = CacheImage::instance();
     $image = $images->resize($institution->logo, 100, 100);
     $form = $this->form(array('name' => $institution->name, 'institutiontype_id' => $institution->institution_type_id, 'logo' => $institution->logo, 'website' => $institution->website, 'address' => $institution->address, 'config' => $config_settings), $submitted);
     Breadcrumbs::add(array('System', Url::site('system')));
     $success = Session::instance()->get('success');
     Session::instance()->delete('success');
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:53,代码来源:system.php

示例11: action_index

 public function action_index()
 {
     $oauth = Google_Oauth::factory(Google_Oauth::SPREADSHEETS);
     $oauth->_req_token_callback = Url::site('/upload/auth', true);
     $auth_token = $oauth->get_req_token();
     if (!$auth_token) {
         throw new Exception('Could not obtain auth token.');
     }
     $secret = $auth_token['oauth_token_secret'];
     Session::instance()->set('oauth_token_secret', $secret);
     unset($auth_token['oauth_token_secret']);
     $this->request->redirect(Google_Oauth::OAUTH_BASE . Google_Oauth::OAUTH_AUTHTOKEN . Url::query($auth_token));
 }
开发者ID:hkilter,项目名称:OpenSupplyChains,代码行数:13,代码来源:upload.php

示例12: action_feed

 public function action_feed()
 {
     $info = array('title' => __($this->metadata->title), 'pubDate' => date('r'), 'description' => $this->metadata->description, 'language' => I18n::lang(), 'ttl' => 60);
     $news = ORM::factory('Publication')->where('published', '=', 1)->order_by('date', 'desc')->limit(40)->find_all();
     $items = array();
     foreach ($news as $item) {
         $items[] = array('title' => $item->title, 'description' => strip_tags($item->desc), 'image' => isset($item->picture->file_path) && $item->picture->file_path ? URL::media($item->picture->file_path, TRUE) : '', 'content' => strip_tags($item->text), 'link' => Url::site('publications/view/' . $item->id, true), 'pubDate' => date('r', strtotime($item->date)));
     }
     header('Content-Type: text/xml; charset=utf-8');
     $xml = Feed::create($info, $items, 'UTF-8');
     echo $xml;
     die;
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:13,代码来源:Rss.php

示例13: action_index

 public function action_index()
 {
     $view = View::factory('calendar/index')->bind('calendar', $calendar)->bind('day_events', $day_events)->bind('month', $month)->bind('year', $year)->bind('months', $months)->bind('years', $years);
     $month = Arr::get($_GET, 'month', date('m'));
     $year = Arr::get($_GET, 'year', date('Y'));
     Breadcrumbs::add(array('Calendar', Url::site(sprintf('calendar?month=%s&year=%s', $month, $year))));
     $calendar = Request::factory('calendar/calendar')->method(Request::GET)->execute()->body();
     $day_events = Request::factory('calendar/day_events')->method(Request::GET)->execute()->body();
     $months = array_map(array(__CLASS__, 'month_names'), Date::months());
     // var_dump($months); exit;
     $present_year = date('Y');
     $years = range($present_year - 10, $present_year + 10);
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:14,代码来源:calendar.php

示例14: delete

 public function delete()
 {
     $url = Registry::getUrl();
     $id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
     $mosca = new Mosca($id);
     if ($mosca->id) {
         if ($mosca->delete()) {
             Registry::addMessage("Mosca eliminada satisfactoriamente", "success");
             //Log
             Log::add(LOG_DELETE_MOSCA, $mosca);
         }
     }
     Url::redirect(Url::site("moscas"));
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:14,代码来源:moscas.php

示例15: doLogin

 /**
  * Login action
  */
 public function doLogin()
 {
     $user = User::login($_REQUEST['login'], $_REQUEST['password']);
     //Try to login
     if ($user->id) {
         //Add success message
         Registry::addMessage("", "", "", Url::site());
     } else {
         //Add error message and redirect to login form view
         Registry::addMessage("Datos incorrectos", "error", "login");
     }
     //Show ajax JSON response
     $this->ajax();
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:17,代码来源:login.php


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