當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Swift::getInstance方法代碼示例

本文整理匯總了PHP中Swift::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Swift::getInstance方法的具體用法?PHP Swift::getInstance怎麽用?PHP Swift::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Swift的用法示例。


在下文中一共展示了Swift::getInstance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getJQuery

 /**
  * Returns a HTML script tag which includes the jquery.js engine into the web page.
  * to ensure HTML5 compatability for MSIE.
  * @return string An HTML script tag.
  */
 public function getJQuery()
 {
     $s = Swift::getInstance();
     return $this->createJavaScriptTag($s->config('app_url') . "/Swift/includes/js/jquery/jquery-1.10.2.min.js");
 }
開發者ID:dskeba,項目名稱:warbank,代碼行數:10,代碼來源:SwiftHtml.php

示例2: renderForm

 /**
  * Outputs the SwiftForm HTML to the page.
  * @param string $style The style type for displaying the SwiftForm (plain, list, table). Default: plain. (Optional)
  * @return string The HTML source code for the SwiftForm.
  */
 public function renderForm($style = 'plain')
 {
     if ($this->m_form_container_id) {
         $form_out .= "<div id=\"" . $this->m_form_container_id . "\">";
     }
     if ($this->m_form_ajax) {
         $swift = Swift::getInstance();
         $swift_jq = $swift->createJQuery();
         $form_out .= $swift_jq->createAjaxCallback('ajax_callback_' . $this->m_form_id, $this->m_form_container_id, 'html');
         $form_out .= $swift_jq->createAjaxFunction('ajax_' . $this->m_form_id, $this->m_form_action, $this->m_form_method, $this->m_field_ids, 'ajax_callback_' . $this->m_form_id);
     }
     $form_out .= "<form";
     if ($this->m_form_name) {
         $form_out .= " name=\"" . $this->m_form_name . "\"";
     }
     if ($this->m_form_id) {
         $form_out .= " id=\"" . $this->m_form_id . "\"";
     }
     if ($this->m_form_action && !$this->m_form_ajax) {
         $form_out .= " action=\"" . $this->m_form_action . "\"";
     }
     if ($this->m_form_method && !$this->m_form_ajax) {
         $form_out .= " method=\"" . $this->m_form_method . "\"";
     }
     if ($this->m_form_enctype) {
         $form_out .= " enctype=\"" . $this->m_form_enctype . "\"";
     }
     $form_out .= ">\n";
     if ($style == 'table') {
         $form_out .= "<table>";
     } else {
         if ($style == 'list') {
             $form_out .= "<ul>";
         }
     }
     for ($i = 0; $i < count($this->m_fields); $i++) {
         if ($style == 'table') {
             $form_out .= "<tr>";
             $form_out .= "<td>" . $this->m_labels[$i] . "</td>";
             $form_out .= "<td>" . $this->m_fields[$i] . "</td>";
             $form_out .= "</tr>";
         } else {
             if ($style == 'plain') {
                 $form_out .= $this->m_labels[$i];
                 $form_out .= $this->m_fields[$i];
                 $form_out .= "</br>";
             } else {
                 if ($style == 'list') {
                     $form_out .= "<li>" . $this->m_labels[$i] . " " . $this->m_fields[$i] . "</li>";
                 }
             }
         }
     }
     if ($style == 'table') {
         $form_out .= "</table>";
     } else {
         if ($style == 'list') {
             $form_out .= "</ul>";
         }
     }
     $form_out .= "</form>\n";
     if ($this->m_form_container_id) {
         $form_out .= "</div>";
     }
     echo $form_out;
 }
開發者ID:dskeba,項目名稱:warbank,代碼行數:71,代碼來源:SwiftForm.php

示例3: render

 /**
  * Loads the provided $view file from inside the directory provided by the app_view_dir setting
  * and loads all variables inside the $data array.
  * @param string $view The filename of a view to render/load.
  * @param Array $data Array of variables to load in the public scope for the $view. (Default: null)
  * @param boolean $minify Minimize and compress all HTML and JavaScript output from the $view. (Default: false)
  */
 public function render($view, $data = null, $minify = false)
 {
     $path = $this->m_config->get('app_view_dir') . '/' . $view;
     if (isset($data)) {
         $result = array_merge($this->m_view_data->getAll(), $data);
         $this->m_view_data->setAll($result);
     }
     $all_data = $this->getAllViewData();
     extract($all_data);
     if ($minify) {
         ob_start();
         require $path;
         $buffer = ob_get_clean();
         $swift = Swift::getInstance();
         $sm = $swift->createMinify();
         echo $sm->minifyString($buffer);
     } else {
         require $path;
     }
 }
開發者ID:dskeba,項目名稱:warbank,代碼行數:27,代碼來源:Swift.php

示例4: getJQuery

 /**
  * Returns a HTML script tag which includes the jquery.js engine into the web page.
  * to ensure HTML5 compatability for MSIE.
  * @return string An HTML script tag.
  */
 public function getJQuery()
 {
     $s = Swift::getInstance();
     $sh = $s->createHtml();
     return $sh->getJQuery();
 }
開發者ID:dskeba,項目名稱:warbank,代碼行數:11,代碼來源:SwiftJQuery.php


注:本文中的Swift::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。