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


PHP Services::get方法代码示例

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


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

示例1: login

 public function login($email = false, $passwd = false)
 {
     $email || ($email = $this->getPost('email'));
     $passwd || ($passwd = $this->getPost('passwd'));
     $orbit = new Orbit();
     $client = $orbit->get('client/login', 1, 1, array('email' => $email, 'passwd' => $passwd));
     if ($client['status'] == 200) {
         $phones = $orbit->get('client/phones/' . $client['uid']['id']);
         UID::set($client['uid']);
         UID::set('phones', $phones['phones']);
         $orbit = new Orbit();
         $favRequest = $orbit->get('client/countfav', 1, 1, array('id' => UID::get('id')));
         $favs = $favRequest['fav'];
         $cartRequest = $orbit->get('client/countcart', 1, 1, array('id' => UID::get('id')));
         $carts = $cartRequest['cart'];
         $this->commitReplace($carts, '#cartitems');
         $this->commitReplace($favs, '#favitems');
         $product_id = $this->getQueryString('product_id');
         if ($product_id) {
             $productPage = Services::get('products');
             $productPage->setId($product_id);
             $productPage->viewProduct();
             return;
         }
         $home = Services::get('home');
         $home->homePage();
         return;
     }
     $this->commitReplace('O e-mail e senha não foram encontrados', '#loginmsg');
     $this->commitShow('#loginmsg');
 }
开发者ID:elvisdandrea,项目名称:delicatessi,代码行数:31,代码来源:clientControl.php

示例2: indexAction

 public function indexAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $defaultItems = array($this->view->serverUrl() . BASEDIR => '1.00000', $this->view->serverUrl() . BASEDIR . '/fale-conosco' => '0.80000', $this->view->serverUrl() . BASEDIR . '/quem-somos' => '0.80000', $this->view->serverUrl() . BASEDIR . '/imoveis/listagem?oportunidades=Sim&e=oportunidades' => '0.80000', $this->view->serverUrl() . BASEDIR . 'imoveis/listagem?lancamento=Sim&e=lancamentos' => '0.80000', $this->view->serverUrl() . BASEDIR . 'bairros/listagem' => '0.80000');
     $xml = new SimpleXMLElement('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></urlset>');
     foreach ($defaultItems as $urlItem => $priority) {
         $url = $xml->addChild('url');
         $url->addChild('loc', htmlentities($urlItem));
         $url->addChild('lastmod', date('Y-m-dTh:i:s+00:00'));
         $url->addChild('changefreq', 'monthly');
         $url->addChild('priority', $priority);
     }
     $vista = Services::get('vista_rest');
     $totalPages = 2;
     for ($page = 1; $page < $totalPages; $page++) {
         $vista->setPaginationParam($page, 50);
         $vista->buscaImoveis(array());
         $totalPages = intval($vista->getTotalPages());
         $result = $vista->getResult();
         foreach ($result as $row) {
             $url = $xml->addChild('url');
             $url->addChild('loc', $this->view->serverUrl() . BASEDIR . '/imoveis/detalhes/codigo/' . $row['Codigo'] . '/' . $row['Categoria'] . '/' . $row['Bairro'] . (intval($row['Dormitorios']) > 0 ? '-' . $row['Dormitorios'] : '') . '/Zona+Sul-Porto+Alegre');
             $url->addChild('lastmod', date('Y-m-dTh:i:s+00:00'));
             $url->addChild('changefreq', 'monthly');
             $url->addChild('priority', '0.90000');
         }
     }
     file_put_contents(APPLICATION_PATH . '/../public/sitemap.xml', $xml->asXML());
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:30,代码来源:SiteMapController.php

示例3: indexAction

 public function indexAction()
 {
     $this->view->bodyClass = 'pg-interna';
     $vista = Services::get('vista_rest');
     $this->view->listas = $vista->getListasBusca();
     $form = new Site_Form_FaleConoscoForm();
     $this->view->form = $form;
     $params = $this->_request->getParams();
     $this->view->headScript()->appendFile($this->view->serverUrl() . BASEDIR . '/res/js/quem-somos.js');
     $vista = Services::get('vista_rest');
     $users = $vista->getDadosUsuarios();
     $grouped = array();
     $groups = array();
     array_walk($users, function ($user) use(&$grouped, &$groups) {
         $group = String::RemoveIndex($user['Equipesite']);
         $groups[] = strtolower($group);
         $grouped[$group][] = $user;
     });
     $title = 'Equipe AG3 Imóveis';
     $filterGroup = $this->getRequest()->getParam('t');
     if (in_array($filterGroup, $groups)) {
         $title = ucwords($filterGroup);
         $grouped = array($title => $grouped[$title]);
     }
     $this->view->showGroups = !in_array($filterGroup, $groups);
     $this->view->title = $title;
     $this->view->users = $grouped;
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:28,代码来源:QuemSomosController.php

示例4: indexAction

 public function indexAction()
 {
     $form = new Application_Form_FaleConoscoForm();
     $this->view->form = $form;
     $params = $this->_request->getParams();
     if ($this->_request->isPost() && $form->isValid($params)) {
         try {
             $vista = Services::get('vista_rest');
             $vista->getAuthEmail();
             $smtpData = $vista->getResult();
             $config = array('auth' => 'login', 'username' => $smtpData['user'], 'password' => $smtpData['pass'], 'port' => $smtpData['port']);
             $transport = new Zend_Mail_Transport_Smtp($smtpData['smtp'], $config);
             Zend_Mail::setDefaultTransport($transport);
             $html = new Zend_View();
             $html->setScriptPath(APPLICATION_PATH . '/views/scripts/fale-conosco/');
             $html->data = $params;
             $emailBody = $html->render('email-body.phtml');
             $mail = new Zend_Mail();
             $mail->setBodyHtml($emailBody);
             $mail->setFrom('atendimento@esselence.com.br', $params['nome']);
             $mail->addTo('atendimento@esselence.com.br', 'Esselence');
             $mail->setSubject("Contato pelo Site {$params['nome']}");
             $mail->send();
             $this->view->success = true;
         } catch (Exception $e) {
             print_r($e->getMessage());
             exit;
         }
     }
 }
开发者ID:elvisdandrea,项目名称:esselence,代码行数:30,代码来源:FaleConoscoController.php

示例5: listagemAction

 public function listagemAction()
 {
     $this->view->bodyClass = 'pg-interna';
     $vista = Services::get('vista_rest');
     $this->view->listas = $vista->getListasBusca();
     $bairros = Gravi_Service_ImochatService::getBairros();
     $this->view->bairros = $bairros['hoods'];
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:8,代码来源:BairrosController.php

示例6: __construct

 /**
  * Constructor
  *
  * Sets up the client
  */
 public function __construct()
 {
     $this->restClient = Services::get('restclient');
     $this->restClient->addHeader('Accept', 'application/json');
     $this->restClient->setFormat('json');
     $this->loadConfig();
     $this->restClient->setUrl($this->getURL());
     $this->restClient->addParam('key', $this->getConfig('key'));
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:14,代码来源:Vista.php

示例7: resolveFacadeInstance

 /**
  * Löst die Facade gegen die eigentliche Implementierung auf.
  * Hierbei ist zu beachten, dass eine Facade-Instanz als Accessor
  * auch direkt eine Klasse zurückgeben kann!
  *
  * @param $name
  * @return mixed
  */
 protected static function resolveFacadeInstance($name)
 {
     if (is_object($name)) {
         return $name;
     }
     if (isset(static::$resolvedInstances[$name])) {
         return static::$resolvedInstances[$name];
     }
     return static::$resolvedInstances[$name] = Services::get($name);
 }
开发者ID:new-frontiers,项目名称:nostromo-contracts,代码行数:18,代码来源:Facade.php

示例8: detalhesAction

 public function detalhesAction()
 {
     $this->view->headScript()->appendFile($this->view->serverUrl() . BASEDIR . '/res/js/detalhes.js');
     $imoCodigo = $this->_request->getParam('codigo');
     if (empty($imoCodigo)) {
         //TODO -- Criar tela de imovel não encontrado
     }
     $vista = Services::get('vista_rest');
     $vista->getDadosImovel($imoCodigo);
     $dadosImovel = $vista->getResult();
     if (empty($dadosImovel)) {
         //TODO -- Criar tela de imovel não encontrado
     }
     $form = new Application_Form_FaleConoscoForm();
     $this->view->form = $form;
     $this->view->imovel = $dadosImovel;
 }
开发者ID:elvisdandrea,项目名称:esselence,代码行数:17,代码来源:ImoveisController.php

示例9: testRegisterService

 function testRegisterService()
 {
     Services::unregisterAllServices();
     Services::registerServiceFactory("test/service", new CachedInstanceServiceFactory(new MyService()));
     $this->assertTrue(Services::is_registered("test/service"), "Il servizio non e' stato registrato!!");
     $this->assertTrue(Services::get("test/service") instanceof MyService, "Il servizio non corrisponde alla classe registrata!!");
     $all_services = Services::get_all_registered_services();
     $this->assertEqual(count($all_services), 1, "Il numero dei servizi registrati non corrisponde!!");
     $this->assertEqual($all_services[0], "test/service", "Il nome del servizio registrato non corrisponde!!");
     Services::registerServiceFactory("test/service2", new NewInstanceServiceFactory("MyService2"));
     $this->assertTrue(Services::is_registered("test/service2"), "Il servizio non e' stato registrato!!");
     $this->assertTrue(Services::get("test/service2") instanceof MyService2, "Il servizio non corrisponde alla classe registrata!!");
     $all_services = Services::get_all_registered_services();
     $this->assertEqual(count($all_services), 2, "Il numero dei servizi registrati non corrisponde!!");
     Services::unregisterAllServices();
     $all_services = Services::get_all_registered_services();
     $this->assertEqual(count($all_services), 0, "Il numero dei servizi registrati non corrisponde!!");
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:18,代码来源:services_test.php

示例10: respond

 public function respond()
 {
     header("Content-type: {$this->content_type}; charset={$this->charset}");
     http_response_code($this->status_code);
     if ($this->content_type === 'application/json') {
         return $this->encode_json($this->data);
     } else {
         if (substr($this->content_type, 0, 5) === 'image') {
             return file_get_contents($this->data);
         } else {
             if ($this->content_type === 'text/html') {
                 if (isset($this->view)) {
                     $te = Services::get('TemplateEngine');
                     return $te->display($this->view, $this->data);
                 } else {
                     return $this->data;
                 }
             } else {
                 return $this->data;
             }
         }
     }
 }
开发者ID:boudra,项目名称:yapf,代码行数:23,代码来源:Response.php

示例11: indexAction

 public function indexAction()
 {
     $vista = Services::get('vista_rest');
     $vista->getListasBusca();
     $this->view->listas = $vista->getResult();
     $vista->reset();
     $filtroBanner = array('SuperDestaqueWeb' => 'Sim');
     $pagination = array('pagina' => 1, 'quantidade' => 5);
     $vista->buscaImoveis($filtroBanner, $pagination);
     $this->view->banners = $vista->getResult();
     $vista->reset();
     $filtroWidget1 = array('EmDestaque' => 'Sim');
     $vista->buscaImoveis($filtroWidget1);
     $this->view->widget1 = $vista->getResult();
     $this->view->widget1Title = 'Destaques';
     //        $vista->reset();
     //
     //        $filtroWidget2 = array(
     //            'Categoria'     => 'Casa'
     //        );
     //
     //        $vista->buscaImoveis($filtroWidget2);
     //        $this->view->widget2 = $vista->getResult();
 }
开发者ID:elvisdandrea,项目名称:esselence,代码行数:24,代码来源:IndexController.php

示例12: indexAction

 public function indexAction()
 {
     $this->view->headScript()->appendFile($this->view->serverUrl() . BASEDIR . '/res/js/imoveis.js');
     $this->view->headScript()->appendFile($this->view->serverUrl() . BASEDIR . '/res/js/index.js');
     $vista = Services::get('vista_rest');
     $this->view->listas = $vista->getListasBusca();
     $vista->reset();
     $pagination = array('pagina' => 1, 'quantidade' => 4);
     $banners = Gravi_Service_ImochatService::getBanners();
     $this->view->banners = $banners['banners'];
     $filtroWidget1 = array('Destinacao' => 'ALUGUEL', 'EmDestaque' => 'Sim');
     $order = array('DataCadastro' => 'desc');
     $vista->buscaImoveis($filtroWidget1, $pagination, $order);
     $this->view->widget1 = $vista->getResult();
     $vista->reset();
     $filtroWidget2 = array('Destinacao' => 'VENDA', 'EmDestaque' => 'Sim');
     $pagination = array('pagina' => 1, 'quantidade' => 4);
     $vista->buscaImoveis($filtroWidget2, $pagination, $order);
     $this->view->widget2 = $vista->getResult();
     $filtroWidget3 = array('Destinacao' => 'VENDA', 'Lancamento' => 'Sim');
     $pagination = array('pagina' => 1, 'quantidade' => 8);
     $vista->buscaImoveis($filtroWidget3, $pagination, $order);
     $this->view->widget3 = $vista->getResult();
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:24,代码来源:IndexController.php

示例13: addFavourite

 public function addFavourite()
 {
     if (!UID::isLoggedIn()) {
         $client = Services::get('client');
         $client->register();
         return;
     }
     $orbit = new Orbit();
     $favs = $orbit->post('client/favourites/' . UID::get('id'), array('product_id' => $this->getQueryString('id')));
     #debug($favs);
     $favRequest = $orbit->get('client/countfav', 1, 1, array('id' => UID::get('id')));
     $countfavs = $favRequest['fav'];
     $this->commitReplace(intval($countfavs), '#favitems');
     $this->view()->loadTemplate('favlink');
     $this->commitReplace($this->view()->render(), '#addfav');
 }
开发者ID:elvisdandrea,项目名称:delicatessi,代码行数:16,代码来源:productsControl.php

示例14: indexAction

 public function indexAction()
 {
     $this->view->bodyClass = 'pg-interna';
     $vista = Services::get('vista_rest');
     $this->view->listas = $vista->getListasBusca();
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:6,代码来源:FinanciamentoController.php

示例15: getSemelhantes

 private function getSemelhantes($imovel)
 {
     $vista = Services::get('vista_rest');
     $vista->reset();
     $similarFields = array('Categoria', 'Bairro', 'Status');
     $filters = array();
     array_walk($similarFields, function ($item) use(&$filters, $imovel) {
         !isset($imovel[$item]) || ($filters[$item] = $imovel[$item]);
     });
     if ($imovel['Dormitorios'] > 0) {
         $filters['Dormitorios'] = array('>=', $imovel['Dormitorios']);
     }
     if ($imovel['Vagas'] > 0) {
         $filters['Vagas'] = array('>=', $imovel['Vagas']);
     }
     $min = intval($imovel['ValorVenda']) - intval($imovel['ValorVenda']) * 20 / 100;
     $max = intval($imovel['ValorVenda']) + intval($imovel['ValorVenda']) * 20 / 100;
     $filters['ValorVenda'] = array($min, $max);
     $filters['Codigo'] = array('!=', $imovel['Codigo']);
     $vista->setPaginationParam(1, 4);
     $vista->buscaImoveis($filters);
     $sem_filters = array('tipo' => $filters['Categoria'], 'bairros' => $filters['Bairro'], 'valor_min' => $filters['ValorVenda'][0], 'valor_max' => $filters['ValorVenda'][1], 'codigo' => $filters['Codigo']);
     !isset($filters['Dormitorios']) || ($sem_filters['dormitorios'] = $filters['Dormitorios']);
     !isset($filters['Vagas']) || ($sem_filters['vagas'] = $filters['Vagas']);
     $this->view->filter_semelhantes = $sem_filters;
     return $vista->getResult();
 }
开发者ID:elvisdandrea,项目名称:ag3,代码行数:27,代码来源:ImoveisController.php


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