• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Presenter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: saveCredit

 /**
  * Saves a new product credit
  *
  * @param int $market_id
  * @param int $presenter_sequence_id The presenter sequence id
  * @param int $credit_type
  * @param decimal $amount
  * @param int $user_id
  * @return boolean
  */
 public function saveCredit($market_id, $presenter_sequence_id, $credit_type, $amount, $user_id)
 {
     $entry_type_id = 2;
     $status_type_id = 2;
     $ref = CakeSession::read('admin_user')->id;
     $entry_user = 'Customer service portal';
     //convert presenter sequence id to primary key id
     require_once APPLICATION_PATH . MODEL_DIR . '/Presenter.php';
     $presenter = new Presenter();
     $presenter_id = $presenter->getIdBySequenceId($presenter_sequence_id);
     $sql = "INSERT INTO {$this->_table_name} " . "(market_id, user_id, presenter_id, product_credit_type_id, product_credit_entry_type_id, product_credit_status_type_id, entry_user, created, reference_id, amount) " . "VALUES (:market, :user, :presenter, :type, :entry, :status, :entry_user, NOW(), :ref, :amt)";
     $query = $this->_db->prepare($sql);
     $query->bindParam(':market', $market_id);
     $query->bindParam(':user', $user_id);
     $query->bindParam(':presenter', $presenter_id);
     $query->bindParam(':type', $credit_type);
     $query->bindParam(':entry', $entry_type_id);
     $query->bindParam(':status', $status_type_id);
     $query->bindParam(':ref', $ref);
     $query->bindParam(':entry_user', $entry_user);
     $query->bindParam(':amt', $amount);
     if ($query->execute()) {
         return TRUE;
     }
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:35,代码来源:Product_credits.php


示例2: testCallThrowsBadMethodCallException

 public function testCallThrowsBadMethodCallException()
 {
     $presenter = new Presenter(new stdClass());
     try {
         $presenter->someInvalidMethod();
     } catch (BadMethodCallException $e) {
         $this->assertRegExp("/Presenter::someInvalidMethod\\(\\)/", $e->getMessage());
         return;
     }
     $this->fail('BadMethodCallException has not been raised.');
 }
开发者ID:jamierumbelow,项目名称:presenters,代码行数:11,代码来源:PresenterTest.php


示例3: action_search

 public function action_search()
 {
     $coupons = "";
     try {
         $coupons = unserialize(Cache::get('cache_coupons'));
     } catch (\CacheNotFoundException $e) {
         $curl = Request::forge('http://allcoupon.jp/api-v1/coupon', 'curl');
         $curl->set_params(array('output' => 'json', 'apikey' => '9EBgSyRbAPmutrWE'));
         // this is going to be an HTTP POST
         $curl->set_method('get');
         $curl->set_auto_format(true);
         $result = $curl->execute()->response();
         $coupons = json_decode($result->body);
         Cache::set('cache_coupons', serialize($coupons), 300);
     }
     if ($area = Input::get('area')) {
         $coupons = array_filter($coupons, function ($v, $k) {
             return $v->coupon_area == Input::get('area');
         }, ARRAY_FILTER_USE_BOTH);
     }
     if ($category = Input::get('category')) {
         $coupons = array_filter($coupons, function ($v, $k) {
             return $v->category_name == Input::get('category');
         }, ARRAY_FILTER_USE_BOTH);
     }
     $view = Presenter::forge('home/search');
     $view->set('title', $area, false);
     $view->set('area', $area, false);
     $view->set('category', $category, false);
     $view->set('coupons', $coupons, false);
     $this->template->content = $view;
 }
开发者ID:eva-bi,项目名称:coupon,代码行数:32,代码来源:home.php


示例4: action_index

 public function action_index($view_path, $id)
 {
     $post_input = Input::post();
     // First of all turn the submitted data into a FuelPHP model representation.
     $form_data_object = new \EBS\Form_Data($post_input);
     // Now go through and save created models and run validation.
     $model_validation = new \EBS\Form_Save_Models($form_data_object->models_and_actions);
     if (!$model_validation->run()) {
         $this->response->highlight_fields = $model_validation->get_highlightfields();
         foreach ($model_validation->database_errors as $database_error) {
             // Create alerts specific to database errors for debugging purposes.
             // Perhaps this should only be shown if in DEV environment.
             $this->response->alerts[] = new \EBS\Response_Alert("There was a database error! Message: {$database_error->getMessage()}", 'danger', '', 0);
         }
     } else {
         // If that's successful, set the response success to true, as we're all done!
         $this->response->success = true;
         // Check if there was a view to generate and send back as well.
         if ($view_path !== null) {
             // Get the path for the view request.
             $view_path = str_replace('_', '/', $view_path);
             $updated_view = new \EBS\Response_View();
             $updated_view->html = Presenter::forge($view_path)->set('id', $id)->render();
             $updated_view->context = Input::post('response_target');
             $this->response->updated_views[] = $updated_view;
         }
     }
     // Encode the response object as JSON and send it back to the UI!
     return Response::forge(json_encode($this->response));
 }
开发者ID:stabernz,项目名称:wnb,代码行数:30,代码来源:submit.php


示例5: action_index

 public function action_index()
 {
     $exports = ['news' => Presenter::forge('portal/component/news'), 'slider' => View_Twig::forge('portal/component/slider')];
     $this->template->title = 'Metro Royal';
     $this->template->navigation = View_Twig::forge('portal/_navigation');
     $this->template->content = View_Twig::forge('portal/index', $exports);
 }
开发者ID:NoguHiro,项目名称:metro,代码行数:7,代码来源:portal.php


示例6: action_index

 public function action_index()
 {
     /**
      * Skills page, Computer Networking, Information Management, Web Development, Art and Design
      */
     $this->template->content = Presenter::forge('skills/page');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:7,代码来源:index.php


示例7: editPermissions

 public function editPermissions()
 {
     /** @var SettingsHandler $manageHandler */
     $manageHandler = app('xe.settings');
     $permissionGroups = $manageHandler->getPermissionList();
     return \Presenter::make('settings.permissions', compact('permissionGroups'));
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:7,代码来源:SettingsController.php


示例8: action_index

 public function action_index()
 {
     /**
      * Communication
      */
     $this->template->content = Presenter::forge('skills/page', 'communication_view');
     //        $this->template->content = Presenter::forge('skills/communication');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:8,代码来源:communication.php


示例9: action_404

 public function action_404()
 {
     $messages = array('Uh Oh!', 'Huh ?');
     $data['notfound_title'] = $messages[array_rand($messages)];
     $data['title'] = '<h1>404 Times</h1>';
     $this->template->title = __('page-not-found');
     $this->template->content = Presenter::forge('frontpage/page')->set('content', View::forge('404', $data));
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:8,代码来源:template.php


示例10: action_index

 public function action_index()
 {
     /**
      *  Art and Design
      */
     $this->template->content = Presenter::forge('skills/page', 'design_view');
     //        $this->template->content = Presenter::forge('skills/design');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:8,代码来源:design.php


示例11: action_index

 public function action_index()
 {
     /**
      *  Web Development
      */
     //        $this->template->content = Presenter::forge('skills/development');
     $this->template->content = Presenter::forge('skills/page', 'development_view');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:8,代码来源:development.php


示例12: action_index

 public function action_index()
 {
     /**
      *  Information Management.
      */
     $this->template->content = Presenter::forge('skills/page', 'information_view');
     //        $this->template->content = Presenter::forge('skills/information');
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:8,代码来源:information.php


示例13: startup

 protected function startup()
 {
     if (!$this->lang) {
         $this->lang = 'sk';
     }
     // not calling parent::startup to avoid redirection to Homepage
     Presenter::startup();
     //		parent::startup();
 }
开发者ID:radypala,项目名称:maga-website,代码行数:9,代码来源:ErrorPresenter.php


示例14: loadDataByPresenterSequenceId

 /**
  * Loads a coupon presenter record
  *
  * If noe exists, this function will create it and then load the record just created.
  *
  * @param int $presenter_sequence_id
  */
 public function loadDataByPresenterSequenceId($presenter_sequence_id)
 {
     //first get the presenter id
     require_once APPLICATION_PATH . MODEL_DIR . '/Presenter.php';
     $presenter = new Presenter();
     $presenter_id = $presenter->getIdBySequenceId($presenter_sequence_id);
     //then see if there's a record for that presenter
     $this->data = $this->getDataByPresenterId($presenter_id);
     //add if not
     if ($this->data == FALSE) {
         $sql = "INSERT INTO {$this->_table_name} " . "(presenter_id,coupon_id,start_date,end_date,max_redemptions,discount_percentage,discount_flat) " . "VALUES(:p_id, 1, NOW(),'0000-00-00 00:00:00',-1,50,0) ";
         $query = $this->_db->prepare($sql);
         $query->bindParam(':p_id', $presenter_id);
         $query->execute();
         $coupon_presenter_id = $this->_db->lastInsertId();
         $this->data = $this->getDataById($coupon_presenter_id);
     }
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:25,代码来源:Coupon_presenter.php


示例15: restoreRequest

 /**
  * Restores current request to session.
  * @param  string key
  * @return void
  */
 public function restoreRequest($key)
 {
     $session = $this->getSession('Nette.Application/requests');
     if (isset($session[$key])) {
         $request = clone $session[$key];
         unset($session[$key]);
         $request->setFlag(PresenterRequest::RESTORED, TRUE);
         $this->presenter->terminate(new ForwardingResponse($request));
     }
 }
开发者ID:jaroslavlibal,项目名称:MDW,代码行数:15,代码来源:Application.php


示例16: action_view

 public function action_view($id = null)
 {
     $article = Model_Article::find_by_url_title($id);
     if ($article) {
         $view = Presenter::forge('article/view');
         $view->set('article', $article);
         $this->template->set('content', $view);
     } else {
         return Response::forge(Presenter::forge('welcome/404'), 404);
     }
 }
开发者ID:sajans,项目名称:cms,代码行数:11,代码来源:article__.php


示例17: action_index

 public function action_index($view = 'basic')
 {
     // Put navigation view into header
     $this->_header->set('navigation', $this->_navigation);
     // Grab presenter to be used for layout
     $presenter = Presenter::forge('account/page')->set('header', $this->_header);
     // Get view and place in presenter
     $data['user'] = $this->_user;
     $view = View::forge('account/' . $view . '/index', $data);
     $presenter->set('content', $view);
     $this->template->content = $presenter;
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:12,代码来源:account.php


示例18: view

 public function view()
 {
     $initial_content = '';
     $meta_description = '';
     $organisation = '';
     $assets = [Asset::css(['ebs.css', 'bootstrap.css']), Asset::js(['jquery-2.1.4.js', 'ebs.js', 'bootstrap.js', 'confirm-bootstrap.js'])];
     $nav_header = Presenter::forge('layouts/index/header');
     $content = View::forge('layout/content', ['content' => $initial_content]);
     $nav_footer = Presenter::forge('layouts/index/footer');
     $ebs = View::forge('layout/ebs', ['meta_description' => $meta_description, 'organisation' => $organisation, 'assets' => $assets, 'nav_header' => $nav_header, 'content' => $content, 'alert_area' => View::forge('layout/alert_area'), 'nav_footer' => $nav_footer], false);
     $this->ebs = $ebs;
 }
开发者ID:stabernz,项目名称:wnb,代码行数:12,代码来源:index.php


示例19: startup

 public function startup()
 {
     parent::startup();
     $this->loadBlackboard();
     $this->loadBlock(function () {
         $block = $this->blackboard->getRandomParent();
         if ($block) {
             $this->redirectToEntity($this->blackboard, $block);
         }
     });
     $this->loadSchema(function () {
         if (!$this->block) {
             return NULL;
         }
         $schema = $this->block->getRandomParent();
         if ($schema) {
             $this->redirectToEntity($this->blackboard, $this->block, $schema);
         }
     });
     if ($this->block && !$this->block->contains($this->blackboard)) {
         $this->redirectToEntity($this->blackboard);
     }
     if ($this->block && $this->schema && !$this->schema->contains($this->block)) {
         $this->redirectToEntity($this->blackboard);
     }
     $this->checkSlug($this->blackboard);
 }
开发者ID:VasekPurchart,项目名称:khanovaskola-v3,代码行数:27,代码来源:Blackboard.php


示例20: startup

 protected function startup()
 {
     parent::startup();
     if ($this->user->isLoggedIn() && $this->action != 'out') {
         $this->redirect(':Admin:Homepage:');
     }
 }
开发者ID:joseki,项目名称:sandbox,代码行数:7,代码来源:SignPresenter.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Presscore_Config类代码示例发布时间:2022-05-23
下一篇:
PHP Prefs类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap