本文整理汇总了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));
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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');
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例11: clear
/**
* Smartyへ割り当てた値を破棄します。
*
* @param string|array $key 破棄する変数名、もしくは、破棄する変数名の配列
* @return Smarty 現在のインスタンス
*/
public function clear($key)
{
Arr::delete($this->_assign, $key);
return $this;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}