当前位置: 首页>>代码示例>>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;未经允许,请勿转载。