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