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


PHP Arr::delete方法代碼示例

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


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

示例1: action_generate

 /**
  * Generate database documentation
  *
  * @access public
  * @return Response
  */
 public function action_generate()
 {
     $this->template->active = 'generate';
     $data = array();
     if (Input::method() === 'POST') {
         /**
          * get Fieldset instance
          */
         $platform = Input::post('platform');
         $fieldset = static::_get_form($platform);
         /**
          * validation
          */
         $validation = $fieldset->validation();
         if ($validation->run(Input::post())) {
             $config = $validated = $validation->validated();
             Arr::delete($config, 'platform');
             Arr::delete($config, 'name');
             Arr::delete($config, 'submit');
             Arr::delete($config, Config::get('security.csrf_token_key'));
             /**
              * directory
              */
             $dir = DOCROOT . 'dbdocs' . DS . $validated['name'] . DS . 'dbdoc' . DS;
             /**
              * generate
              */
             $dd = Dbdocs::forge('default', $config);
             try {
                 $ret = $dd->generate($dir, true);
                 if ($ret !== true) {
                     Session::set_flash('error', 'System error occurred.');
                 }
                 Session::set_flash('success', 'Generated database documentation "' . $validated['name'] . '" !!');
             } catch (Exception $e) {
                 Session::set_flash('error', 'System error occurred.');
             }
             Response::redirect();
         } else {
             $validated = $validation->validated();
             $data['platform'] = $platform;
             Arr::delete($validated, Config::get('security.csrf_token_key'));
             $data['form'] = $fieldset->populate($validated);
             $this->template->content = View::forge('index/generate', array('data' => $data));
             Session::set_flash('error', $validation->error());
         }
     } else {
         $this->template->content = View::forge('index/generate', array('data' => $data));
     }
 }
開發者ID:kenjis,項目名稱:fuel-dbdocs,代碼行數:56,代碼來源:index.php

示例2: delete

 /**
  * Deletes a (dot notated) config item
  *
  * @param
  *        	string a (dot notated) config key
  * @return array|bool the \Arr::delete result, success boolean or array of success booleans
  */
 public static function delete($item)
 {
     if (isset(static::$itemcache[$item])) {
         unset(static::$itemcache[$item]);
     }
     return \Arr::delete(static::$items, $item);
 }
開發者ID:vienbk91,項目名稱:fuelphp17,代碼行數:14,代碼來源:config.php

示例3: delete

 /**
  * delete session variables
  *
  * @param	string	name of the variable to delete
  * @param	mixed	value
  * @access	public
  * @return	Fuel\Core\Session_Driver
  */
 public function delete($name)
 {
     \Arr::delete($this->data, $name);
     return $this;
 }
開發者ID:SainsburysTests,項目名稱:sainsburys,代碼行數:13,代碼來源:driver.php

示例4: delete

 /**
  * Deletes a (dot notated) language string
  *
  * @param    string       $item      a (dot notated) language key
  * @param    string       $group     group
  * @param    string|null  $language  name of the language to set, null for the configurated language
  * @return   array|bool              the \Arr::delete result, success boolean or array of success booleans
  */
 public static function delete($item, $group = null, $language = null)
 {
     $group === null or $line = $group . '.' . $line;
     if ($language === null) {
         $languages = static::$fallback;
         array_unshift($languages, $language ?: \Config::get('language'));
         $language = reset($languages);
     }
     return isset(static::$lines[$language]) ? \Arr::delete(static::$lines[$language], $item) : false;
 }
開發者ID:wushian,項目名稱:MDD,代碼行數:18,代碼來源:lang.php

示例5: delete

 /**
  * Deletes a (dot notated) language string
  *
  * @param    string       $item      a (dot notated) language key
  * @param    string       $group     group
  * @param    string|null  $language  name of the language to set, null for the configurated language
  * @return   array|bool              the \Arr::delete result, success boolean or array of success booleans
  */
 public static function delete($item, $group = null, $language = null)
 {
     $group === null or $item = $group . '.' . $item;
     $language === null and $language = static::get_lang();
     return isset(static::$lines[$language]) ? \Arr::delete(static::$lines[$language], $item) : false;
 }
開發者ID:SainsburysTests,項目名稱:sainsburys,代碼行數:14,代碼來源:lang.php

示例6: action_credits

 /**
  * Buy credits checkout
  *
  * @access  public
  * @return  void
  */
 public function action_credits()
 {
     \View::set_global('title', 'Purchase Credits');
     if (\Input::post('buy')) {
         $products = array();
         $total = array('price' => 0, 'save' => 0);
         $bundles = \Input::post('bundles');
         $prices = \Config::get('job.bundles.multiple', array());
         // Rename array keys
         foreach ($bundles as $key => $value) {
             $new_key = str_replace('::', '.', $key);
             $bundles[$new_key] = $value;
             \Arr::delete($bundles, $key);
             if (\Arr::get($prices, $new_key, false)) {
                 list($quantity, $option) = explode('.', $new_key);
                 $product = \Arr::get($prices, $new_key);
                 $product['title'] = $quantity . ' Pack Job Bundle / ' . ucfirst($option);
                 $products[$key] = $product;
                 $total['price'] += $product['price'];
                 $total['save'] += $product['save'];
             }
         }
         // Save result in session
         \Session::set('checkout', array('products' => $products, 'total' => $total));
     } elseif (!\Session::get('checkout') || !\Session::get('checkout.products', array())) {
         // Session must exist to access this page. Return to purchase credits page
         $purchase_page = \Page\Model_Page::get_locked_pages('purchase_page', true);
         \Response::redirect(\Uri::front_create('page/' . $purchase_page->seo->slug));
     }
     // Set session key just to meke sure user can not retur to payment page from any other page but this
     \Session::set('payment_key', \Str::random('unique'));
     $this->page_theme = \Theme::instance()->set_partial('content', $this->view_dir . 'credits');
 }
開發者ID:EdgeCommerce,項目名稱:edgecommerce,代碼行數:39,代碼來源:checkout+copy.php

示例7: clear_list

 /**
  * {@inheritdoc}
  */
 protected function clear_list($list)
 {
     is_array($list) or $list = array($list);
     foreach ($list as $_list) {
         $rcpt = array_keys($this->{$_list});
         \Arr::delete($this->rcpt_merge_vars, $rcpt);
         \Arr::delete($this->rcpt_metadata, $rcpt);
     }
     return parent::clear_list($list);
 }
開發者ID:socialskeptic,項目名稱:sainsburys,代碼行數:13,代碼來源:mandrill.php

示例8: prep_props

 protected function prep_props(array $props)
 {
     // Skip tree fields and primary keys
     $skip_fields = \Arr::merge(Model_Menu::primary_key(), Model_Menu::tree_config(), array('children'));
     \Arr::delete($skip_fields, array('read-only', 'title_field'));
     // Model properties
     $properties = \Arr::filter_keys($props, array_keys(Model_Menu::properties()));
     $properties = \Arr::filter_keys($properties, $skip_fields, true);
     //Model 'fields' property fields
     $fields = \Arr::filter_keys($props, array_keys($properties), true);
     $fields = \Arr::filter_keys($fields, $skip_fields, true);
     is_array($properties['fields']) or $properties['fields'] = array();
     $properties['fields'] = \Arr::merge($properties['fields'], $fields);
     return $properties;
 }
開發者ID:indigophp,項目名稱:fuel-menu,代碼行數:15,代碼來源:db.php

示例9: getContents

 /**
  * Returns the container's data
  *
  * @return array
  */
 public function getContents()
 {
     // make a copy to leave the original container untouched
     $data = $this->data;
     // delete all expired variables
     foreach ($data[static::EXPIRE_DATA_KEY] as $key => $expiration) {
         if ($expiration[1] === static::EXPIRE_STATE_EXPIRED) {
             unset($data[static::EXPIRE_DATA_KEY][$key]);
             \Arr::delete($data, $this->prefixKey($key));
         }
     }
     // and return what's left over
     return $data;
 }
開發者ID:fuelphp,項目名稱:session,代碼行數:19,代碼來源:FlashContainer.php

示例10: delete

 /**
  * Delete an item from the session data
  *
  * @param     string     Session data key
  * @returns   boolean    True if successful
  */
 public function delete($key)
 {
     return Arr::delete($_SESSION, $key);
 }
開發者ID:nerdsrescueme,項目名稱:Core,代碼行數:10,代碼來源:session.php

示例11: clear

 /**
  * Smartyへ割り當てた値を破棄します。
  *
  * @param string|array $key 破棄する変數名、もしくは、破棄する変數名の配列
  * @return Smarty 現在のインスタンス
  */
 public function clear($key)
 {
     Arr::delete($this->_assign, $key);
     return $this;
 }
開發者ID:Ragg-,項目名稱:CodeLapse,代碼行數:11,代碼來源:Smarty.php

示例12: delete

 /**
  * Deletes a (dot notated) config item
  *
  * @param    string       a (dot notated) config key
  * @return   array|bool   the \Arr::delete result, success boolean or array of success booleans
  */
 public static function delete($item)
 {
     return \Arr::delete(static::$items, $item);
 }
開發者ID:phabos,項目名稱:fuel-core,代碼行數:10,代碼來源:config.php

示例13: delete

 /**
  * Delete data from the container
  *
  * @param   string   $key  key to delete
  * @return  boolean  delete success boolean
  * @since   2.0.0
  */
 public function delete($key)
 {
     if ($this->readOnly) {
         throw new \RuntimeException('Changing values on this Data Container is not allowed.');
     }
     $this->isModified = true;
     if (($result = Arr::delete($this->data, $key)) === false and $this->parentEnabled) {
         $result = $this->parent->delete($key);
     }
     return $result;
 }
開發者ID:armano2,項目名稱:common,代碼行數:18,代碼來源:DataContainer.php

示例14: delete

 /**
  * @param string|null $name 削除するセッション変數のキー
  *     nullを指定するとセッション変數をクリアします。
  * @see Arr::delete() Arr::deleteメソッド
  */
 public static function delete($name = null)
 {
     return Arr::delete(self::getInstance()->session, $name);
 }
開發者ID:Ragg-,項目名稱:CodeLapse,代碼行數:9,代碼來源:Session.php

示例15: delete

 /**
  * Deletes a (dot notated) language string
  *
  * @param    string       a (dot notated) language key
  * @param    string       group
  * @return   array|bool   the \Arr::delete result, success boolean or array of success booleans
  */
 public static function delete($item, $group = null)
 {
     $group === null or $line = $group . '.' . $line;
     return \Arr::delete(static::$lines, $item);
 }
開發者ID:beingsane,項目名稱:TTII_2012,代碼行數:12,代碼來源:lang.php


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