当前位置: 首页>>代码示例>>PHP>>正文


PHP arr::defaults方法代码示例

本文整理汇总了PHP中arr::defaults方法的典型用法代码示例。如果您正苦于以下问题:PHP arr::defaults方法的具体用法?PHP arr::defaults怎么用?PHP arr::defaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在arr的用法示例。


在下文中一共展示了arr::defaults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($filename, array $options = null, array $headermap = null)
 {
     $this->options = arr::defaults((array) $options, array('delimiter' => ',', 'enclosure' => '"', 'escape' => "\\", 'length' => 2048, 'null' => '*NULL*'));
     $this->headermap = $headermap;
     $this->fh = fopen($filename, 'r');
     $this->filesize = filesize($filename);
     $this->timer = new Timer(false);
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:8,代码来源:csvfile.php

示例2: __construct

    public function __construct($label, $key, Array $items = null, Array $options = null) {
        
        $this->label = $label;
        $this->setKey($key);
        // Here we will do a little check to see if the array we are passed is
        // indexed with a key ( $k => $v ), or if it's simply an array of arrays
        // i.e. a recordset from a database query. If this is the case, we will
        // go over the list and massage it to be indexed with a key.

        if (count($items)>0) {
            if (typeOf($items[0]) == 'array') {
                $newarr = array();
                // Repopulate the list with keys properly assigned
                foreach($items as $item) {
                    $newarr[$item[0]] = $item[1];
                }
                // And update the item list with our newly populated one
                $items = $newarr;
            }
            // Now we update the main list
            $this->items = $items;
        }
        $this->options = arr::defaults($options, array(
            'class' => 'wf-row'
        ));
        
    }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:27,代码来源:basic.php

示例3: addStep

 /**
  * @brief Add a step to the wizard.
  * 
  * @param IWizardStep $step The step as a IWizardStep instance
  * @param string $key The key of the step (f.ex. 'basic')
  * @param string $name The name of the step (f.ex. 'Basic Information')
  * @param array $options Options for the step
  */
 public function addStep(IWizardStep $step, $key, $name, array $options = null)
 {
     // These are the defaults we will use
     $defaults = array('title' => $name, 'novalidate' => false);
     // Apply the defaults to the options
     $options = arr::defaults($options, $defaults);
     // And add the step with the new options attached
     $this->steps[] = array('step' => $step, 'key' => $key, 'name' => $name, 'options' => $options);
     // Now go over the data for the step to see if it has already been
     // validated and saved. We do this with the initialize method.
     $step->setForm($this);
     $step->initialize($this->getFormToken());
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:21,代码来源:wizard.php


注:本文中的arr::defaults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。