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


PHP Helpers::addClass方法代碼示例

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


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

示例1: open

 /**
  * Opens up magically a form
  *
  * @param  string $typeAsked  The form type asked
  * @param  array  $parameters Parameters passed
  * @return string             A form opening tag
  */
 public function open($typeAsked, $parameters)
 {
     $method = 'POST';
     $secure = false;
     $action = array_get($parameters, 0);
     $attributes = array_get($parameters, 1);
     // If classic form
     if ($typeAsked == 'open') {
         $type = Former::$defaultFormType;
     } else {
         // Look for HTTPS form
         if (str_contains($typeAsked, 'secure')) {
             $typeAsked = str_replace('secure', null, $typeAsked);
             $secure = true;
         }
         // Look for file form
         if (str_contains($typeAsked, 'for_files')) {
             $typeAsked = str_replace('for_files', null, $typeAsked);
             $attributes['enctype'] = 'multipart/form-data';
         }
         // Calculate form type
         $type = trim(str_replace('open', null, $typeAsked), '_');
         if (!in_array($type, $this->availableTypes)) {
             $type = Former::$defaultFormType;
         }
     }
     // Add the final form type
     $attributes = Helpers::addClass($attributes, 'form-' . $type);
     // Store it
     $this->type = $type;
     // Open the form
     return \Form::open($action, $method, $attributes, $secure);
 }
開發者ID:nigobo,項目名稱:laravel-play,代碼行數:40,代碼來源:Form.php

示例2: open

 /**
  * Opens up magically a form
  *
  * @param  string $typeAsked  The form type asked
  * @param  array  $parameters Parameters passed
  * @return string             A form opening tag
  */
 public function open($typeAsked, $parameters)
 {
     $action = array_get($parameters, 0);
     $method = array_get($parameters, 1, 'POST');
     $attributes = array_get($parameters, 2, array());
     $secure = array_get($parameters, 3, false);
     // If classic form
     if ($typeAsked == 'open') {
         $type = Config::get('default_form_type');
     } else {
         // Look for HTTPS form
         if (str_contains($typeAsked, 'secure')) {
             $typeAsked = str_replace('secure', null, $typeAsked);
             $secure = true;
         }
         // Look for file form
         if (str_contains($typeAsked, 'for_files')) {
             $typeAsked = str_replace('for_files', null, $typeAsked);
             $attributes['enctype'] = 'multipart/form-data';
         }
         // Calculate form type
         $type = trim(str_replace('open', null, $typeAsked), '_');
         if (!in_array($type, $this->availableTypes)) {
             $type = Config::get('default_form_type');
         }
     }
     // Add the final form type
     $attributes = Helpers::addClass($attributes, 'form-' . $type);
     // Store it
     $this->type = $type;
     // Fetch errors if asked for
     if (Config::get('fetch_errors')) {
         Former::withErrors();
     }
     // Open the form
     $this->action = $action;
     $this->method = $method;
     $this->attributes = $attributes;
     $this->secure = $secure;
     return $this;
 }
開發者ID:iyoworks,項目名稱:former,代碼行數:48,代碼來源:Form.php

示例3: show

 /**
  * Return html.
  *
  * @return string
  */
 public function show()
 {
     return self::view('indicator', ['tag' => $this->tag, 'attributes' => Helpers::addClass($this->attributes, $this->class . ' ' . $this->type), 'message' => $this->message]);
 }
開發者ID:aperdia,項目名稱:aperdiaui,代碼行數:9,代碼來源:Indicator.php

示例4: addClass

 /**
  * Add a class to the current field
  *
  * @param string $class The class to add
  */
 public function addClass($class)
 {
     $this->attributes = Helpers::addClass($this->attributes, $class);
 }
開發者ID:nigobo,項目名稱:laravel-play,代碼行數:9,代碼來源:Field.php


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