本文整理汇总了PHP中Zofe\Rapyd\DataForm\Field\Field类的典型用法代码示例。如果您正苦于以下问题:PHP Field类的具体用法?PHP Field怎么用?PHP Field使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Field类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValue
public function getValue()
{
Field::getValue();
$this->values = explode($this->serialization_sep, $this->value);
foreach ($this->values as $value) {
$values[] = $this->isoDateToHuman($value);
}
if (isset($values)) {
$this->value = implode($this->serialization_sep, $values);
}
}
示例2: build
function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = $this->checked ? $this->checked_output : $this->unchecked_output;
}
break;
case "create":
case "modify":
$output = Form::checkbox($this->name, $this->checked_value, $this->checked) . $this->extra_output;
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例3: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "show":
$output = $this->value;
$output = "<div class='help-block' style='background-color:" . $output . "'> </div>";
break;
case "create":
case "modify":
Rapyd::css('colorpicker/css/bootstrap-colorpicker.min.css');
Rapyd::js('colorpicker/js/bootstrap-colorpicker.min.js');
$output = Form::text($this->name, $this->value, $this->attributes);
$output .= Rapyd::script("\n \$('#" . $this->name . "').colorpicker({\n format: 'hex'\n });");
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例4: build
public function build()
{
$output = "";
unset($this->attributes['type'], $this->attributes['size']);
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = $this->description;
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
$output = Form::select($this->name, $this->options, $this->value, $this->attributes) . $this->extra_output;
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例5: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
Rapyd::js('redactor/jquery.browser.min.js');
Rapyd::js('redactor/redactor.min.js');
Rapyd::css('redactor/css/redactor.css');
$output = Form::textarea($this->name, $this->value, $this->attributes);
Rapyd::script("\$('#" . $this->name . "').redactor();");
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例6: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = $this->description;
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
foreach ($this->options as $val => $label) {
$this->checked = (!is_null($this->value) and $this->value == $val);
$output .= Form::radio($this->name, $val, $this->checked) . ' ' . $label . $this->separator;
}
$output .= $this->extra_output;
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例7: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
$output = Form::text($this->name, $this->value, array_merge(array('class' => 'col-xs-12'), $this->attributes));
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例8: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = "********";
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
$output = Form::password($this->name, $this->attributes);
break;
case "hidden":
$output = "";
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例9: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
Rapyd::js('tinymce/tinymce.min.js');
Rapyd::js('tinymce/tinymce_editor.js');
$output = Form::textarea($this->name, $this->value, $this->attributes);
Rapyd::script("function elFinderBrowser (field_name, url, type, win) {" . "tinymce.activeEditor.windowManager.open({" . "file: '" . route('elfinder.tinymce4') . "'," . "title: 'elFinder 2.0'," . "width: 900," . "height: 450," . "resizable: 'yes'" . "}, {" . "setUrl: function (url) {" . "win.document.getElementById(field_name).value = url;" . "}" . "});" . "return false;" . "}");
Rapyd::script("tinymce.init({selector: '#" . $this->name . "', file_browser_callback : elFinderBrowser, plugins: 'image', convert_urls: false});");
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例10: build
public function build()
{
$output = "";
$this->attributes["class"] = "btn btn-default";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
break;
case "create":
case "modify":
$output = Form::submit($this->label, $this->attributes);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例11: build
public function build()
{
$output = "";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = $this->checked ? $this->checked_output : $this->unchecked_output;
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
//dd($this->checked);
$output = Form::checkbox($this->name, $this->checked_value, $this->checked, $this->attributes) . $this->extra_output;
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例12: build
public function build()
{
$output = "";
$this->attributes["class"] = "form-control";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
$output = "<div class='help-block'>" . $output . "</div>";
break;
case "create":
case "modify":
$output = Form::file($this->db_name, $this->attributes);
break;
case "hidden":
$output = Form::hidden($this->db_name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例13: build
public function build()
{
$output = "";
$this->attributes["class"] = "form-control";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = "<img border=\"0\" src=\"//maps.googleapis.com/maps/api/staticmap?center={$this->value['lat']},{$this->value['lon']}&zoom={$this->zoom}&size=500x500\">";
}
$output = "<div class='help-block'>" . $output . "</div>";
break;
case "create":
case "modify":
$output = Form::hidden($this->lat, $this->value['lat'], ['id' => $this->lat]);
$output .= Form::hidden($this->lon, $this->value['lon'], ['id' => $this->lon]);
$output .= '<div id="map_' . $this->name . '" style="width:500px; height:500px"></div>';
$output .= '<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>';
\Rapyd::script("\n \n function initialize()\n {\n var latitude = document.getElementById('{$this->lat}');\n var longitude = document.getElementById('{$this->lon}');\n var zoom = {$this->zoom};\n \n var LatLng = new google.maps.LatLng(latitude.value, longitude.value);\n \n var mapOptions = {\n zoom: zoom,\n center: LatLng,\n panControl: false,\n zoomControl: true,\n scaleControl: true,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n \n var map = new google.maps.Map(document.getElementById('map_{$this->name}'),mapOptions);\n \n var marker = new google.maps.Marker({\n position: LatLng,\n map: map,\n title: 'Drag Me!',\n draggable: true\n });\n \n google.maps.event.addListener(marker, 'dragend', function (event) {\n latitude.value = event.latLng.lat();\n longitude.value = event.latLng.lng();\n });\n \n }\n initialize();\n ");
break;
case "hidden":
$output = '';
//Form::hidden($this->db_name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}
示例14: build
public function build()
{
$output = "";
if (!isset($this->style)) {
$this->style = "margin:0 2px 0 0; vertical-align: middle";
}
unset($this->attributes['id']);
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = $this->description;
}
$output = "<div class='help-block'>" . $output . " </div>";
break;
case "create":
case "modify":
$this->attributes['multiple'] = 'multiple';
$this->attributes['data-placeholder'] = $this->attributes['placeholder'];
$this->attributes['placeholder'] = null;
$output .= Form::select($this->name . '[]', $this->options, $this->values, $this->attributes);
$output .= $this->extra_output;
break;
case "hidden":
$output = Form::hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例15: build
public function build()
{
$output = "";
$this->attributes["class"] = "form-control";
if (parent::build() === false) {
return;
}
switch ($this->status) {
case "disabled":
case "show":
if ($this->type == 'hidden' || $this->value == "") {
$output = "";
} elseif (!isset($this->value)) {
$output = $this->layout['null_label'];
} else {
$output = nl2br(htmlspecialchars($this->value));
}
$output = "<div class='help-block'>" . $output . "</div>";
break;
case "create":
case "modify":
Rapyd::js('packages/zofe/rapyd/assets/tinymce/tinymce.min.js');
$output = Form::textarea($this->db_name, $this->value, $this->attributes);
$output .= Rapyd::script("\n tinymce.init({\n selector: 'textarea#" . $this->name . "',\n plugins: [\n 'advlist autolink link image lists charmap print preview hr anchor pagebreak',\n 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',\n 'save table contextmenu directionality emoticons template paste textcolor responsivefilemanager'\n ],\n toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | responsivefilemanager | print preview media fullpage | forecolor backcolor emoticons', \n image_advtab: true ,\n external_filemanager_path:'" . URL::to('/') . "/packages/filemanager/',\n filemanager_title:'Upload',\n });");
break;
case "hidden":
$output = Form::hidden($this->db_name, $this->value);
break;
default:
}
$this->output = "\n" . $output . "\n" . $this->extra_output . "\n";
}