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


PHP View::element方法代码示例

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


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

示例1: _render

 /**
  * Render the contents using the current layout and template.
  * Overridden to support plugin templates
  *
  * @param   string  $content Content to render
  * @return  array   Email ready to be sent
  */
 public function _render($content)
 {
     $msg = array();
     $content = implode("\n", $content);
     if ($this->sendAs === 'both') {
         $htmlContent = $content;
         if (!empty($this->attachments)) {
             $msg[] = '--' . $this->__boundary;
             $msg[] = 'Content-Type: multipart/alternative; boundary="alt-' . $this->__boundary . '"';
             $msg[] = '';
         }
         $msg[] = '--alt-' . $this->__boundary;
         $msg[] = 'Content-Type: text/plain; charset=' . $this->charset;
         $msg[] = 'Content-Transfer-Encoding: 7bit';
         $msg[] = '';
         $content = $this->_view->element('email' . DS . 'text' . DS . $this->template, array('content' => $content, 'plugin' => 'Referee'), true);
         $this->_view->layoutPath = 'email' . DS . 'text';
         $content = explode("\n", $this->textMessage = str_replace(array("\r\n", "\r"), "\n", $this->_view->renderLayout($content)));
         $msg = array_merge($msg, $content);
         $msg[] = '';
         $msg[] = '--alt-' . $this->__boundary;
         $msg[] = 'Content-Type: text/html; charset=' . $this->charset;
         $msg[] = 'Content-Transfer-Encoding: 7bit';
         $msg[] = '';
         $htmlContent = $this->_view->element('email' . DS . 'html' . DS . $this->template, array('content' => $htmlContent, 'plugin' => 'Referee'), true);
         $this->_view->layoutPath = 'email' . DS . 'html';
         $htmlContent = explode("\n", $this->htmlMessage = str_replace(array("\r\n", "\r"), "\n", $this->_view->renderLayout($htmlContent)));
         $msg = array_merge($msg, $htmlContent);
         $msg[] = '';
         $msg[] = '--alt-' . $this->__boundary . '--';
         $msg[] = '';
         return $msg;
     }
     if (!empty($this->attachments)) {
         if ($this->sendAs === 'html') {
             $msg[] = '';
             $msg[] = '--' . $this->__boundary;
             $msg[] = 'Content-Type: text/html; charset=' . $this->charset;
             $msg[] = 'Content-Transfer-Encoding: 7bit';
             $msg[] = '';
         } else {
             $msg[] = '--' . $this->__boundary;
             $msg[] = 'Content-Type: text/plain; charset=' . $this->charset;
             $msg[] = 'Content-Transfer-Encoding: 7bit';
             $msg[] = '';
         }
     }
     $content = $this->_view->element('email' . DS . $this->sendAs . DS . $this->template, array('content' => $content, 'plugin' => 'Referee'), true);
     $this->_view->layoutPath = 'email' . DS . $this->sendAs;
     $content = explode("\n", $rendered = str_replace(array("\r\n", "\r"), "\n", $this->_view->renderLayout($content)));
     if ($this->sendAs === 'html') {
         $this->htmlMessage = $rendered;
     } else {
         $this->textMessage = $rendered;
     }
     $msg = array_merge($msg, $content);
     return $msg;
 }
开发者ID:joebeeson,项目名称:referee,代码行数:65,代码来源:referee_mailer.php

示例2: rescan_locale

 public function rescan_locale()
 {
     if ($this->token->validate('rescan_locale')) {
         $u = new \User();
         if ($u->isSuperUser()) {
             \Core::make('cache/request')->disable();
             $section = Section::getByID($_REQUEST['locale']);
             $target = new MultilingualProcessorTarget($section);
             $processor = new Processor($target);
             if ($_POST['process']) {
                 foreach ($processor->receive() as $task) {
                     $processor->execute($task);
                 }
                 $obj = new \stdClass();
                 $obj->totalItems = $processor->getTotalTasks();
                 echo json_encode($obj);
                 exit;
             } else {
                 $processor->process();
             }
             $totalItems = $processor->getTotalTasks();
             \View::element('progress_bar', array('totalItems' => $totalItems, 'totalItemsSummary' => t2("%d task", "%d tasks", $totalItems)));
             exit;
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:26,代码来源:copy.php

示例3: edit

 public function edit($id = null)
 {
     $this->autoRender = false;
     $content = array();
     if (!$this->Member->exists($id)) {
         throw new NotFoundException(__('Invalid Team'));
     }
     if ($this->request->is(array('post', 'put'))) {
         $this->Member->id = $id;
         $this->Member->set($this->request->data);
         if ($this->Member->save()) {
             $this->Session->setFlash(__('The Member has been saved.'));
         } else {
             $this->Session->setFlash(__('The Member could not be saved. Please, try again.'));
         }
         return $this->redirect(array('action' => 'index'));
     } else {
         $options = array('conditions' => array('Member.' . $this->Member->primaryKey => $id));
         $this->request->data = $this->Member->find('first', $options);
     }
     $options = array('conditions' => array('Member.' . $this->Member->primaryKey => $id));
     $members = $this->Member->find('first', $options);
     $content['members'] = $members;
     $team = $this->Member->Team->find('list', array('fields' => array('team')));
     $content['team'] = $team;
     $view = new View($this, false);
     return $view->element('editMember', array('content' => $content));
 }
开发者ID:katekbg,项目名称:pviewer-layout,代码行数:28,代码来源:MembersController.php

示例4: displayObjectCollection

 public function displayObjectCollection()
 {
     $em = \ORM::entityManager('migration_tool');
     $r = $em->getRepository("\\PortlandLabs\\Concrete5\\MigrationTool\\Entity\\Import\\Batch");
     $batch = $r->findFromCollection($this->collection);
     print \View::element('batch_content_types/' . $this->getElement(), array('batch' => $batch, 'type' => $this->collection->getType(), 'collection' => $this->collection), 'migration_tool');
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:7,代码来源:AbstractFormatter.php

示例5: admin_total_issuers

 /**
  * 
  * @return <array> with chats datas
  */
 public function admin_total_issuers()
 {
     $this->loadModel('Transaction');
     # obtendo sql que captura os dado para o gráfico
     $sql = file_get_contents(APP . 'Outside' . DS . 'Scripts' . DS . 'management_painel' . DS . 'total_issuers.sql');
     $view = new View();
     $this->returnJs($view->element('../Management/admin/partial/total_issuers_table', array('total_issuers' => $this->Transaction->query($sql))));
 }
开发者ID:ribaslucian,项目名称:php-cakephp-2.x-base,代码行数:12,代码来源:ManagementController.php

示例6: html

 public function html($id, $slug = '')
 {
     $pismo = $this->load($id);
     $view = new View($this, false);
     $html = $view->element('html', array('pismo' => $pismo));
     echo $html;
     die;
 }
开发者ID:Marcin11,项目名称:_mojePanstwo-Portal,代码行数:8,代码来源:PismaController.php

示例7: renderElement

 protected function renderElement($element, $data = array())
 {
     $view = new View(ClassRegistry::getObject('EventController'), false);
     $view->set('data', $data);
     $html = $view->element($element, $this->params, true);
     $view = null;
     unset($view);
     return $html;
 }
开发者ID:essential-zz,项目名称:eventful-cakephp,代码行数:9,代码来源:controller_events.php

示例8: rescan_locale

 public function rescan_locale()
 {
     if ($this->token->validate('rescan_locale')) {
         $u = new \User();
         if ($u->isSuperUser()) {
             \Core::make('cache/request')->disable();
             $section = Section::getByID($_REQUEST['locale']);
             $target = new MultilingualProcessorTarget($section);
             $processor = new Processor($target);
             if ($_POST['process']) {
                 foreach ($processor->receive() as $task) {
                     $processor->execute($task);
                 }
                 $obj = new \stdClass();
                 $obj->totalItems = $processor->getTotalTasks();
                 print json_encode($obj);
                 exit;
             } else {
                 $processor->process();
             }
             $totalItems = $processor->getTotalTasks();
             \View::element('progress_bar', array('totalItems' => $totalItems, 'totalItemsSummary' => t2("%d task", "%d tasks", $totalItems)));
             /*
             $q = Queue::get('rescan_multilingual_section');
             if ($_POST['process']) {
                 $obj = new \stdClass;
                 $messages = $q->receive(\Config::get('concrete.limits.copy_pages'));
                 foreach($messages as $key => $p) {
                     // delete the page here
                     $page = unserialize($p->body);
                     $oc = \Page::getByID($page['cID']);
             
             
                     $q->deleteMessage($p);
                 }
             
                 $obj->totalItems = $q->count();
                 print json_encode($obj);
                 if ($q->count() == 0) {
                     $q->deleteQueue('rescan_multilingual_section');
                 }
                 exit;
             
             } else if ($q->count() == 0) {
                 $oc = Section::getByID($_REQUEST['locale']);
                 if (is_object($oc) && !$oc->isError()) {
                     $oc->queueForDeletionRequest($q, false);
                 }
             }
             $totalItems = $q->count();
             \View::element('progress_bar', array('totalItems' => $totalItems, 'totalItemsSummary' => t2("%d page", "%d pages", $totalItems)));
             */
             exit;
         }
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:56,代码来源:copy.php

示例9: index

 public function index()
 {
     // Build conditions table
     $conditions = array();
     if (!empty($this->request->data['Filter']['search'])) {
         $conditions['ProjectProject.title LIKE'] = '%' . $this->request->data['Filter']['search'] . '%';
     }
     $this->Paginator->settings['fields'] = array('ProjectProject.id', 'ProjectProject.title', 'ProjectProject.is_active');
     $this->Paginator->settings['contain'] = array('ProjectTask' => array('id', 'conditions' => array('project_task_status_id NOT IN' => array(4, 5))));
     $this->Paginator->settings['order'] = array('ProjectProject.is_active' => 'DESC', 'ProjectProject.title');
     $projects = $this->Paginator->paginate('ProjectProject', $conditions);
     if ($this->request->is('ajax')) {
         $this->layout = 'ajax';
         $this->autoRender = false;
         $view = new View($this);
         return json_encode(array('content' => $view->element('Project.projects-table-loop', array('projects' => $projects)), 'pagination' => $view->element('pagination')));
     }
     $this->set('projects', $projects);
 }
开发者ID:gezeresolutionsweb,项目名称:cakeproject,代码行数:19,代码来源:ProjectProjectsController.php

示例10: getElements

 public function getElements()
 {
     $this->autoRender = false;
     $view = new View($this, false);
     if ($this->request->is('ajax')) {
         $options = json_decode($this->request->data['options'], true);
         $nome = $this->request->data['nome'];
         echo json_encode($view->element($nome, $options));
     }
 }
开发者ID:alextalha,项目名称:sg,代码行数:10,代码来源:GenericFiltersController.php

示例11: element

 /**
  * Overwrites the View::element() function so we can deal with the $type parameter
  * 
  * @access public
  * @return string The result of View::element()
  */
 function element($name, $params = array(), $loadHelpers = false)
 {
     $typeBkp = $this->getVar('type');
     if (isset($params['type'])) {
         $this->viewVars['type'] = $params['type'];
     }
     $out = parent::element($name, $params, $loadHelpers);
     $this->viewVars['type'] = $typeBkp;
     return $out;
 }
开发者ID:rcaravita,项目名称:jodeljodel,代码行数:16,代码来源:type.php

示例12: deliver

 static function deliver($template, $options = array())
 {
     $options = Set::merge(array('vars' => array(), 'mail' => array('to' => array(), 'from' => Configure::read('App.emails.noReply'), 'charset' => 'utf8', 'sendAs' => 'text', 'subject' => '', 'template' => $template, 'layout' => 'email', 'attachments' => array()), 'store' => false), $options);
     if (!empty($options['mail']['subject'])) {
         $options['mail']['subject'] = strip_tags($options['mail']['subject']);
     }
     $delivery = Configure::read('App.emailDeliveryMethod');
     if (!empty($delivery) && !isset($options['mail']['delivery'])) {
         $options['mail']['delivery'] = $delivery;
     }
     if (isset($options['mail']['delivery']) && $options['mail']['delivery'] == 'smtp') {
         $options['mail']['smtpOptions'] = Configure::read('App.smtpOptions');
     }
     if (Common::isDevelopment()) {
         $options['mail']['delivery'] = 'debug';
     }
     App::import('Core', 'Controller');
     $Email = Common::getComponent('Email');
     Common::setProperties($Email, $options['mail']);
     if (!isset($Email->Controller)) {
         App::import('Core', 'Router');
         $Email->Controller = new AppController();
     }
     $Email->Controller->set($options['vars']);
     if ($options['store']) {
         $hash = sha1(json_encode($options));
         $folder = substr($hash, 0, 2);
         $file = substr($hash, 2) . '.html';
         $url = '/emails/' . $folder . '/' . $file;
         $path = APP . 'webroot' . $url;
         if (!is_dir(dirname($path))) {
             @mkdir(dirname($path));
         }
         $url = Router::url($url, true);
         $Email->Controller->set('emailUrl', $url);
         $View = new View($Email->Controller, false);
         $View->layout = $Email->layout;
         $View->layoutPath = 'email' . DS . 'html';
         $html = $View->element('email' . DS . 'html' . DS . $options['mail']['template'], array('content' => null), true);
         $html = $View->renderLayout($html);
         file_put_contents($path, $html);
     }
     if (!isset($Email->Controller->Session)) {
         $Email->Controller->Session = Common::getComponent('Session');
     }
     $result = $Email->send();
     if (Common::isDevelopment() && Configure::read('App.email_debug')) {
         Common::debugEmail();
     }
     return $result;
 }
开发者ID:stripthis,项目名称:donate,代码行数:51,代码来源:mailer.php

示例13: element

 function element($name, $data = array(), $options = false)
 {
     $element = parent::element($name, $data, $options);
     $hookContainer = ClassRegistry::getObject('HookContainer');
     $before = "";
     if ($hookContainer->getElementHook($name, true)) {
         $before = $this->element($hookContainer->getElementHook($name, true), $data, $options);
     }
     $after = "";
     if ($hookContainer->getElementHook($name)) {
         $after = $this->element($hookContainer->getElementHook($name), $data, $options);
     }
     return $before . $element . $after;
 }
开发者ID:gildonei,项目名称:candycane,代码行数:14,代码来源:CandyView.php

示例14: element

 function element($name, $params = array(), $loadHelpers = false)
 {
     if (!is_array($name)) {
         return parent::element($name, $params, $loadHelpers);
     } else {
         $not_found_str = "Not Found";
         //debug($name);
         foreach ($name as $name) {
             $result = parent::element($name, $params, $loadHelpers);
             if ($result && substr($result, 0, strlen($not_found_str)) != $not_found_str) {
                 return $result;
             }
         }
         return $result;
     }
 }
开发者ID:kevthunder,项目名称:cake-newsletter,代码行数:16,代码来源:newsletter_view.php

示例15: element

 /**
  * Undo Mi logic when reporting an error for a missing view file
  *
  * @param mixed $name
  * @param array $params array()
  * @param bool $loadHelpers false
  * @return void
  * @access public
  */
 function element($name, $params = array(), $loadHelpers = false)
 {
     $return = parent::element($name, $params, $loadHelpers);
     if (strpos($return, 'Not Found:') === 0) {
         $plugin = null;
         if (isset($params['plugin'])) {
             $plugin = $params['plugin'];
         }
         if (isset($this->plugin) && !$plugin) {
             $plugin = $this->plugin;
         }
         $paths = $this->_paths($plugin);
         $path = array_pop($paths);
         while ($paths && strpos($path, DS . 'locale' . DS)) {
             $path = array_pop($paths);
         }
         $file = $path . 'elements' . DS . $name . $this->ext;
         return "Not Found: " . $file;
     }
     return $return;
 }
开发者ID:hiromi2424,项目名称:mi,代码行数:30,代码来源:mi.php


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