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


PHP Arr::insert_after_key方法代碼示例

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


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

示例1: field

 /**
  * Get Field instance
  *
  * @param   string|null           field name or null to fetch an array of all
  * @param   bool                  whether to get the fields array or flattened array
  * @param   bool                  whether to include tabular form fields in the flattened array
  * @return  Fieldset_Field|false  returns false when field wasn't found
  */
 public function field($name = null, $flatten = false, $tabular_form = true)
 {
     if ($name === null) {
         $fields = $this->fields;
         if ($flatten) {
             foreach ($this->fieldset_children as $fs_name => $fieldset) {
                 if ($tabular_form or !$fieldset->get_tabular_form()) {
                     \Arr::insert_after_key($fields, $fieldset->field(null, true), $fs_name);
                 }
                 unset($fields[$fs_name]);
             }
         }
         return $fields;
     }
     if (!array_key_exists($name, $this->fields)) {
         if ($flatten) {
             foreach ($this->fieldset_children as $fieldset) {
                 if (($field = $fieldset->field($name)) !== false) {
                     return $field;
                 }
             }
         }
         return false;
     }
     return $this->fields[$name];
 }
開發者ID:takawasitobi,項目名稱:pembit,代碼行數:34,代碼來源:fieldset.php

示例2: test_insert_after_value

 /**
  * Tests Arr::insert_after_value()
  * 
  * @test
  */
 public function test_insert_after_value()
 {
     $people = array("Jack", "Jill");
     $expected = array("Jack", "Humpty", "Jill");
     $output = Arr::insert_after_key($people, "Humpty", "Jack");
     $this->assertEquals(true, $output);
     $this->assertEquals($expected, $people);
 }
開發者ID:bryanheo,項目名稱:FuelPHP-Auth-AJAX,代碼行數:13,代碼來源:arr.php

示例3: test_insert_after_key_that_does_not_exist

 /**
  * Tests Arr::insert_after_key()
  *
  * @test
  */
 public function test_insert_after_key_that_does_not_exist()
 {
     $people = array("Jack", "Jill");
     $output = Arr::insert_after_key($people, "Humpty", 6);
     $this->assertFalse($output);
 }
開發者ID:quickpacket,項目名稱:noclayer,代碼行數:11,代碼來源:arr.php

示例4: insert_after

 /**
  * Insert after a specific key.
  * 
  * @access public
  * @return void
  */
 public function insert_after($key, $title, $callback, $ukey = null)
 {
     $this->prepare_insert($callback, $ukey);
     \Arr::insert_after_key($this->properties, $title, $key);
     $this->properties = \Arr::replace_key($this->properties, array(0 => $ukey));
     return $this;
 }
開發者ID:ronan-gloo,項目名稱:FuelPHP-Twitter-Bootstrap,代碼行數:13,代碼來源:table.php


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