使用文件类型显示,多选
value为Array类型

@param       $field
@param       $title
@param       $src
@param array $value
@return Frame
481776
public static function frameImages($field, $title, $src, array $value = [])
    {
        return self::frame($field, $title, $src, $value, Frame::TYPE_IMAGE);
    }
1132945
public static function barDump($var, string $title = null, array $options = null)
    {
        if (!self::isProductionMode()) {
            static $panel;
            if (!$panel) {
                self::getBar()->addPanel($panel = new Bar\DefaultPanel('dumps'), 'Tracy:dumps');
            }
            $panel->data[] = [
                'title' => $title,
                'dump' => Dumper::toHtml($var, $options + [
                        Dumper::DEPTH => self::$maxDepth,
                        Dumper::TRUNCATE => self::$maxLength,
                        Dumper::LOCATION => self::$showLocation ?: Dumper::LOCATION_CLASS | Dumper::LOCATION_SOURCE,
                    ]),
            ];
        }

        return $var;
    }
805061
private function fieldVideo($key, $value, array $fields)
    {
        $before = Json::parse($value[0]);
        $after = Json::parse($value[1]);

        return [
            'type'   => $fields[$key]['type'],
            'before' => [
                'render' => [
                    'url'       => $before['url'],
                    'title'     => $before['title'],
                    'width'     => $before['width'],
                    'height'    => $before['height'],
                    'html'      => $before['html'],
                    'thumbnail' => $before['thumbnail'],
                ],
            ],
            'after'  => [
                'render' => [
                    'url'       => $after['url'],
                    'title'     => $after['title'],
                    'width'     => $after['width'],
                    'height'    => $after['height'],
                    'html'      => $after['html'],
                    'thumbnail' => $after['thumbnail'],
                ],
            ],
        ];
    }
733772
protected function checkItem( $field, $value, $rules, $data, $title = '', $msg = [] )
	{
		if( isset( $this->remove[$field] ) && true === $this->remove[$field] && empty( $this->append[$field] ) ){
			// 字段已经移除 无需验证
			return true;
		}
		// 支持多规则验证 require|in:a,b,c|... 或者 ['require','in'=>'a,b,c',...]
		if( is_string( $rules ) ){
			$rules = explode( '|', $rules );
		}
		if( isset( $this->append[$field] ) ){
			// 追加额外的验证规则
			$rules = array_merge( $rules, $this->append[$field] );
		}
		$lang = require_once "lang/zh-cn.php";
		$i    = 0;
		foreach( $rules as $key => $rule ){
			if( $rule instanceof \Closure ){
				$result = call_user_func_array( $rule, [$value, $data] );
				$info   = is_numeric( $key ) ? '' : $key;
			} else{
				// 判断验证类型
				list( $type, $rule, $info ) = $this->getValidatorType( $key, $rule );
				if( isset( $this->append[$field] ) && in_array( $info, $this->append[$field] ) ){
				} elseif( isset( $this->remove[$field] ) && in_array( $info, $this->remove[$field] ) ){
					// 规则已经移除
					$i ++;
					continue;
				}
				if( 'must' == $info || 0 === strpos( $info, 'require' ) || (!is_null( $value ) && '' !== $value) ){
					// 验证类型
					$callback = isset( self::$type[$type] ) ? self::$type[$type] : [$this, $type];
					// 验证数据
					$result = call_user_func_array( $callback, [$value, $rule, $data, $field, $title] );
				} else{
					$result = true;
				}
			}
			if( false === $result ){
				// 验证失败 返回错误信息
				if( !empty( $msg[$i] ) ){
					$message = $msg[$i];
					if( is_string( $message ) && strpos( $message, '{%' ) === 0 ){
						$message = $lang[substr( $message, 2, - 1 )];
					}
				} else{
					$message = $this->getRuleMsg( $field, $title, $info, $rule );
				}
				return $message;
			} elseif( true !== $result ){
				// 返回自定义错误信息
				if( is_string( $result ) && false !== strpos( $result, ':' ) ){
					$result = str_replace( [':attribute', ':rule'], [$title, (string)$rule], $result );
				}
				return $result;
			}
			$i ++;
		}
		return $result;
	}
966277
protected function file_header( $title, $data = array() ) 
	{	
		$conf = \CCConfig::create( 'shipyard' );
		$data = CCDataObject::assign( $data );
		
		// Build the authors string
		$authors = $data->get( 'authors', $conf->get( 'defaults.authors' ) );		
		
		if ( is_array( $authors ) )
		{
			foreach( $authors as $person ) 
			{
				$author_str .= $person['name']." ";
				if ( array_key_exists( 'email', $person ) ) 
				{
					$author_str .= "<".$person['email'].">";
				}
				$author_str .= ", ";
			}
			$author_str = substr( $author_str, 0, -2 );
		}
		
		// Finish comment heeader
		return "$title\n".
			"*\n".
			"\n".
			"@package       ".$data->get( 'package', $conf->get( 'defaults.package' ) )."\n".
			"@author        ".$author_str."\n".
			"@version       ".$data->get( 'version', $conf->get( 'defaults.version' ) )."\n".
			"@copyright     ".$data->get( 'copyright', $conf->get( 'defaults.copyright' ) )."\n";
	}
976953
public function log($value, $title = '')
    {
        if (!is_null($this->getLogger())) {
            $this->getLogger()->setTitle($title);
            $this->getLogger()->log($value);
        }
    }
357035
public static function a($href, $content = '', $title = '', $target = '', $options = [])
    {
        $a_tag_tpl = '<a href="%s" title="%s" target="%s"%s>%s</a>';
        return sprintf($a_tag_tpl, $href, $title, $target, self::assembleTagOptions($options), $content);
    }
224248
private function selectValue($component, $field, $value)
    {
        $page = $this->getSession()->getPage();

        $this->openComponent($page, $component, $field);
        $this->selectComponentValue($page, $component, $field, $value);
    }
256224
function add_field($name, $title=null, \Closure $display_callback=null, Setting\Section $section=null, $default=null)
    {
        if(is_array($name)){

            $field = $name + [
                $display_callback=null,
                $section = null,
                $default = null,
                $type = 'text'
            ];

        } else {
            //legacy full param format
            $field = compact('name','title','display_callback','section');
        }

        if(empty($field['section'])){
            $field['section'] = $this->get_default_section();
        }

        $this->fields[$field['name']] = $field;
    }
1179093
public function _write($path, $title, $shell)
    {
        $phpdoctor =& $this->_doclet->phpdoctor();

        // make directory separators suitable to this platform
        $path = str_replace('/', DIRECTORY_SEPARATOR, $path);

        // make directories if they don't exist
        $dirs = explode(DIRECTORY_SEPARATOR, $path);
        array_pop($dirs);
        $testPath = $this->_doclet->destinationPath();
        foreach ($dirs as $dir) {
            $testPath .= $dir.DIRECTORY_SEPARATOR;
            if (!is_dir($testPath)) {
                if (!@mkdir($testPath)) {
                    $phpdoctor->error(sprintf('Could not create directory "%s"', $testPath));
                    exit;
                }
            }
        }

        // write file
        $fp = fopen($this->_doclet->destinationPath().$path, 'w');
        if ($fp) {
            $phpdoctor->message('Writing "'.$path.'"');
            fwrite($fp, $this->_htmlHeader($title));
            if ($shell) fwrite($fp, $this->_shellHeader($path));
            fwrite($fp, $this->_output);
            if ($shell) fwrite($fp, $this->_shellFooter($path));
            fwrite($fp, $this->_htmlFooter());
            fclose($fp);
        } else {
            $phpdoctor->error('Could not write "'.$this->_doclet->destinationPath().$path.'"');
            exit;
        }
    }
249006
private function buildField($field, $type, $variable, $value = true)
    {
        $column = strtolower($field['name']);
        $title = ucfirst($field['name']);

        if ($value === true) {
            $value = '$' . $variable . '->' . $column;
        } else {
            $value = 'old("'.$column.'")';
        }

        $syntax = [];

        switch($type) {
            case 'string':
            default:
                $input = 'text';
                break;
            case 'text':
                $input = 'textarea';
                break;
        }

        $syntax[] = '<div class="form-group @if($errors->has('."'". $column . "'".')) has-error @endif">';
        $syntax[] = '   <label for="' . $column . '-field">' . $title . '</label>';

        if($this->illuminate) {
            $syntax[] = '   {!! Form::' . $input . '("' . $column . '", ' . $value . ', array("class" => "form-control", "id" => "' . $column . '-field")) !!}';
        } else {
            $syntax[] = $this->htmlField($column, $variable, $field, $type);
        }

        $syntax[] = '   @if($errors->has("' . $column . '"))';
        $syntax[] = '    <span class="help-block">{{ $errors->first("' . $column . '") }}</span>';
        $syntax[] = '   @endif';
        $syntax[] = '</div>';

        return join("\n".str_repeat(' ', 20), $syntax);
    }
1244901
public function title($title, $url = null)
    {
        $this->title = $title;
        $this->url = $url;

        return $this;
    }
125891
public function addChild(string $title, string $url = '', array $children = [], array $fields = []): Builder
    {
        // Get last item index
        $index = count($this->menu) - 1;

        if ($index < 0) {
            return $this;
        }

        $this->menu[$index]->appendChild($this->parseMenuItems($title, $url, $children, $fields));

        return $this;
    }
157248
public static function frame($field, $title, $src, $value = '', $type = Frame::TYPE_INPUT)
    {
        $length = is_array($value) ? 0 : 1;
        $frame = new Frame($field, $title, $value);
        $frame->maxLength($length)->src($src)->type($type);
        return $frame;
    }
820031
public function sendSingleActionCard(string $title, string $content, string $singleTitle, string $url, bool $hideAvatar = false)
    {
        $data = [
            'msgtype' => 'actionCard',
            'actionCard' => [
                'title' => $title,
                'text' => $content,
                'singleTitle' => $singleTitle,
                'singleURL' => $url,
                'hideAvatar' => $hideAvatar ? '1' : '0',
            ]
        ];

        return $this->postJson($this->getUrl(), $data);
    }
851566
public static function date($field, $title, $value = '')
    {
        return self::datePicker($field, $title, (string)$value, DatePicker::TYPE_DATE);
    }
395616
public static function textarea($field, $title, $value = '')
    {
        return self::input($field, $title, $value, Input::TYPE_TEXTAREA);
    }