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


PHP field::hidden方法代码示例

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


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

示例1: header

 public static function header($form = array())
 {
     if (isset($form['template'])) {
         form::$template = arr::take('template', $form);
     }
     $attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
     $attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
     $attrs['action'] = isset($form['action']) ? $form['action'] : url::current();
     //加载表头
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     //加载常用js
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     //表单头部
     if (isset($form['title']) || isset($form['description'])) {
         $html[] = '<div class="form-header clearfix">';
         $html[] = isset($form['icon']) ? '		<div class="form-icon"></div>' : '';
         $html[] = isset($form['title']) ? '		<div class="form-title">' . $form['title'] . '</div>' : '';
         $html[] = isset($form['description']) ? '		<div class="form-description">' . $form['description'] . '</div>' : '';
         $html[] = '</div>';
     }
     //表单body部分开始
     $html[] = '<div class="form-body">';
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:29,代码来源:form.php

示例2: image

 /**
  * 自定义一个图片控件,该控件只对当前控制器页面有效
  *  
  * @param array 控件参数
  */
 public function image($attrs)
 {
     $html = array();
     $html[] = field::hidden($attrs);
     $html[] = '<div class="textarea" style="margin-top:-1px;height:100px;">';
     $html[] = '	<ul class="zotop-image-list" id="' . $attrs['name'] . '-images">';
     for ($i = 0; $i < 10; $i++) {
         $image = url::theme() . '/image/userface/' . $i . '.gif';
         $class = $attrs['value'] == $image ? 'selected' : 'normal';
         $html[] = '		<li class="' . $class . '"><a href="javascript:void(0);" onfocus="blur()"><img src="' . $image . '" style="width:64px;height:64px;"></a></li>';
     }
     $html[] = '	</ul>';
     $html[] = '</div>';
     $html[] = '
     <script>
     	$(function(){
 			var name = "' . $attrs['name'] . '";
     		var id = "#' . $attrs['name'] . '-images";
     		$(id).find("li").click(function(){
 				var image = $(this).find("img").attr("src");
 				$(this).parents("ul").find("li").removeClass("selected");
 				$(this).addClass("selected");
 				$("#"+name).val(image);
 			})
 		});        
     </script>
     ';
     return implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:34,代码来源:mine.php

示例3: header

 public static function header($form = array())
 {
     if (is_string($form) || is_numeric($form)) {
         $form = array('globalid' => $form);
     }
     if (is_array($form)) {
         $form += array('class' => 'form', 'method' => 'post', 'action' => url::location(), 'globalid' => 0);
     }
     $html[] = '';
     if (arr::take('valid', $form) !== false) {
         $html[] = html::script('$common/js/jquery.validate.js');
     }
     if (arr::take('ajax', $form) !== false) {
         $html[] = html::script('$common/js/jquery.form.js');
     }
     $icon = arr::take('icon', $form);
     $title = arr::take('title', $form);
     $description = arr::take('description', $form);
     $globalid = arr::take('globalid', $form);
     $template = arr::take('template', $form);
     if (!empty($template)) {
         form::$template = $template;
     }
     //加载表头
     $html[] = '<form' . html::attributes($form) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => url::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     $html[] = field::hidden(array('name' => '_GLOBALID', 'value' => empty($globalid) ? form::globalid() : $globalid));
     //表单头部
     if (isset($title) || isset($description)) {
         $html[] = '<div class="form-header clearfix">';
         if (isset($icon)) {
             $html[] = '<div class="form-icon"><div class="zotop-icon zotop-icon-' . $icon . '"></div></div>';
         }
         if (isset($title)) {
             $html[] = '	<div class="form-title">' . $title . '</div>';
         }
         if (isset($description)) {
             $html[] = '	<div class="form-description">' . $description . '</div>';
         }
         $html[] = '</div>';
     }
     $html[] = '<div class="form-body clearfix">';
     $html[] = '';
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:46,代码来源:form.php

示例4: header

 public static function header($header = array())
 {
     if (isset($header['template'])) {
         form::$template = arr::take('template', $header);
     }
     $attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
     $attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
     $attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
     $html[] = isset($header['description']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = html::script(url::common() . '/js/jquery.validate.js');
     $html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
     $html[] = html::script(url::common() . '/js/jquery.form.js');
     $html[] = html::script(url::common() . '/js/zotop.form.js');
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:19,代码来源:form.php

示例5: header

 public static function header($form = array())
 {
     if (is_string($form)) {
         $form['description'] = $form;
     }
     form::$template = isset($form['template']) ? $form['template'] : form::$template;
     form::$globalid = isset($form['globalid']) ? $form['globalid'] : form::$globalid;
     //form 标签
     $attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
     $attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
     $attrs['target'] = isset($form['target']) ? $form['target'] : '';
     $attrs['action'] = isset($form['action']) ? $form['action'] : url::location();
     if (isset($form['enctype']) || isset($form['upload'])) {
         $attrs['enctype'] = 'multipart/form-data';
     }
     //加载表头
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     $html[] = field::hidden(array('name' => '_GLOBALID', 'value' => form::globalid()));
     //加载常用js
     if ($form['valid'] !== false) {
         $html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.validate.js');
     }
     if ($form['ajax'] !== false) {
         $html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.form.js');
     }
     //表单头部
     if (isset($form['title']) || isset($form['description'])) {
         $html[] = '<div class="form-header clearfix">';
         $html[] = isset($form['title']) ? '		<div class="form-title">' . $form['title'] . '</div>' : '';
         $html[] = isset($form['description']) ? '		<div class="form-description">' . $form['description'] . '</div>' : '';
         $html[] = '</div>';
     }
     //表单body部分开始
     $html[] = '<div class="form-body">';
     echo implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:39,代码来源:form.php

示例6: title

 /**
  * 标题输入框,含有标题样式
  *
  * @param $attrs array 控件参数
  * @return string 控件代码
  */
 public static function title($attrs)
 {
     $style = arr::decode($attrs['style'], ';', ':');
     $html[] = html::script('$common/js/jquery.colorpicker.js');
     $html[] = html::script('$common/js/zotop.title.js');
     $html[] = '<div class="field-wrapper clearfix">';
     $html[] = '	' . field::text($attrs);
     $html[] = '	' . field::hidden(array('name' => $attrs['name'] . '_color', 'id' => $attrs['name'] . '_style', 'class' => 'short', 'value' => $style['color']));
     $html[] = '	' . field::hidden(array('name' => $attrs['name'] . '_weight', 'id' => $attrs['name'] . '_weight', 'class' => 'short', 'value' => $style['font-weight']));
     $html[] = '	<span class="field-handle">';
     $html[] = '		<a class="setweight" style="display:inline-block;" valueto="' . $attrs['name'] . '_weight" weightto="' . $attrs['name'] . '" title="' . zotop::t('加粗') . '"><span class="zotop-icon zotop-icon-b"></span></a>';
     $html[] = '		<a class="setcolor" style="display:inline-block;" valueto="' . $attrs['name'] . '_color" colorto="' . $attrs['name'] . '" title="' . zotop::t('色彩') . '"><span class="zotop-icon zotop-icon-setcolor ' . $style['font-weight'] . '"></span></a>';
     $html[] = '	</span>';
     $html[] = '</div>';
     return implode("\n", $html);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:22,代码来源:field.php


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