• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP widget函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中widget函数的典型用法代码示例。如果您正苦于以下问题:PHP widget函数的具体用法?PHP widget怎么用?PHP widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: builder

 /**
  * 配合BuilderView使用
  * 自动加载 application.fields下的字段类型
  */
 static function builder($arr)
 {
     //实例化的beginWidget('CActiveForm')
     $form = $arr['form'];
     //字段名
     $name = $arr['name'];
     $model = $arr['model'];
     $htmlOptions = array('class' => 'form-control');
     //单个字段的详细配置
     $v = $arr['v'];
     //字段类型 对应application.fields下的文件名
     $type = $v['type'];
     $obj = new $type();
     $chtmlField = $obj->type;
     if ($v['widget']) {
         foreach ($v['widget'] as $k => $vo) {
             echo widget($k, $vo);
         }
     }
     if ($type == 'checkbox') {
         $htmlOptions = array('class' => 'checkbox');
     }
     if (!$chtmlField && method_exists($obj, 'action')) {
         return $obj->action($name, $v['model'], $model->{$name});
     }
     if (!$chtmlField) {
         return;
     }
     if (array_key_exists('datas', $v)) {
         $values = $v['datas'];
         $htmlOptions['encode'] = false;
         return $form->{$chtmlField}($model, $name, $values, $htmlOptions);
     }
     return $form->{$chtmlField}($model, $name, $htmlOptions);
 }
开发者ID:hiproz,项目名称:mincms,代码行数:39,代码来源:Helper.php


示例2: widgetsOfSidebar

function widgetsOfSidebar($sidebar)
{
    $widgets = \DB::table("sidebar_widget")->where("sidebar", $sidebar)->get();
    foreach ($widgets as $widget) {
        $widget_object = widget($widget->id_string, $sidebar);
        $widget_object->display($widget->id_string);
    }
}
开发者ID:PhonemeCms,项目名称:cms,代码行数:8,代码来源:helper.php


示例3: testWidgetHelperFunction

 /**
  * testWidgetHelperFunction
  *
  * @return void
  */
 public function testWidgetHelperFunction()
 {
     $handler = $this->handler;
     $containerMock = m::mock('Illuminate\\Contracts\\Container\\Container');
     $handler->shouldReceive('create')->andReturn('test widget called');
     $containerMock->shouldReceive('make')->andReturn($handler);
     Container::setInstance($containerMock);
     $this->assertSame('test widget called', widget('test@testWidgetId', []));
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:14,代码来源:WidgetHelperTest.php


示例4: action

 function action($name, $model, $v)
 {
     if ($v) {
         if (is_array($v)) {
         } else {
             $value = CDB()->from('attachments')->where('id=:id', array(':id' => $v))->queryAll();
         }
     }
     $name = "AutoModel[{$name}]";
     echo widget('plupload', array('field' => $name, 'multi' => false, 'values' => $value));
 }
开发者ID:hiproz,项目名称:mincms,代码行数:11,代码来源:image.php


示例5: actionIndex

 public function actionIndex()
 {
     widget('uisort', array('tag' => '.drag', 'table' => 'modules', 'stop' => "\$.get('" . url('admin/admin/menu') . "',function(data){ \n\t     \t\t\t\$('#menu').html(data);\n\t     \t });\n\t     \t"));
     if ($_POST['uisort_widget_ajax'] != 'uisort_modules') {
         $base = $this->_base;
         $models = Modules::find()->where(array('active' => 1))->orderBy('core asc,sort desc,id asc')->all();
         if ($models) {
             foreach ($models as $model) {
                 $name = $model->name;
                 $array[$name]['name'] = $name;
                 $array[$name]['active'] = $model->active;
                 $array[$name]['core'] = $model->core;
                 $array[$name]['path'] = $base . $name;
                 $array[$name]['info'] = @(include $base . $name . '/info.php');
             }
         }
         foreach (glob($base . '*') as $v) {
             $a = '/controllers';
             $name = str_replace($base, '', $v);
             if (!is_dir($v)) {
                 continue;
             }
             $data[$name]['default'] = false;
             if (file_exists($v . '/lock')) {
                 unset($data[$name]);
                 continue;
             }
             $data[$name]['name'] = $name;
             $data[$name]['path'] = $v;
             $data[$name]['info'] = @(include $v . '/info.php');
             if ($array[$name]) {
                 unset($data[$name]);
             }
             $file[$name] = $name;
         }
         if ($array) {
             foreach ($array as $k => $v) {
                 if (!in_array($k, $file)) {
                     $m = Modules::find(array('name' => $k));
                     $m->delete();
                     unset($array[$k]);
                 }
             }
         }
         if ($array) {
             $data = array_merge($data, $array);
         }
         echo $this->render('index', array('data' => $data, 'models' => $models, '_core_modules' => $this->_core_modules));
     }
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:50,代码来源:ModulesController.php


示例6: widget

<div class="frame-crumbs">
    <?php 
echo widget('path');
?>
</div>
<div class="frame-inside page-text">
    <div class="container">
        <div class="text-right">
            <div class="text">
                <h1><?php 
echo $page['title'];
?>
</h1>
                <?php 
echo $page['full_text'];
?>
                <?php 
$Comments = $CI->load->module('comments')->init($page);
?>
                <?php 
$c = $CI->load->module('comments/commentsapi')->renderAsArray($CI->uri->uri_string());
?>
                <div class="forComments p_r">
                    <?php 
echo $c['comments'];
?>
                </div>
            </div>
        </div>
    </div>
</div><?php 
开发者ID:NavaINT1876,项目名称:skidka,代码行数:31,代码来源:97fcf41db32e76388f012f2ae84a6dda.php


示例7: import

<?php

import('layouts/header', $data['title']);
widget('topnav');
?>
<div class="container">
	<div class="row">
		<div class="col-md-3 hidden-xs hidden-sm">
			<?php 
widget('loginBox');
?>
		</div>
		<div class="col-sm-12 col-md-9">
			<h2 class="page-header" style="margin-top:0;"><?php 
echo $data['title'];
?>
</h2>
			<div id="contents"><?php 
echo $data['content'];
?>
</div>
			<div class="row">
				<div class="col-xs-12">
				<?php 
if (in_array(auth('id'), explode(',', $data['readIn']))) {
    ?>
					<button class="btn btn-default" disabled>รับทราบแล้ว</button>
				<?php 
} else {
    ?>
					<button id="ack" class="btn btn-primary">รับทราบแล้ว</button>
开发者ID:Jakkarin,项目名称:Anchor-system-for-branch-or-group,代码行数:31,代码来源:news.blade.php


示例8: csrf_token

							type: 'post',
							data : { id: id, csrf_token: '<?php 
    echo csrf_token();
    ?>
' },
							success: function(json) {
								getAll();
							}
						});
					}
				}
			</script>
		<?php 
} else {
    ?>
			<?php 
    widget('InActive');
    ?>
			<div class="alert alert-warning">
				<h3><i class="glyphicon glyphicon-bullhorn"></i> ประกาศ</h3><hr />
				<p>ขณะนี้คุณยังไม่สามารถใช้งานระบบได้ กรุณารอจนกว่าประธานสาขาของคุณจะตรวจสอบและรับเข้านะครับ</p>
				<p>ต้องขออภัยในความไม่สะดวก</p><hr />
			</div>
		<?php 
}
?>
		</div>
	</div>
</div>
<?php 
import('layouts/footer');
开发者ID:Jakkarin,项目名称:Anchor-system-for-branch-or-group,代码行数:31,代码来源:index.blade.php


示例9: widget

                              <td>
                                <?php 
    echo widget('Admin.Category')->edit($value);
    ?>
                                <?php 
    echo widget('Admin.Category')->delete($value);
    ?>
                              </td>
                            </tr>
                          <?php 
}
?>
                        </tbody>
                      </table>
                      </div>
                  </div>
              </div>
          </div>
          <?php 
echo $page;
?>
        </div>
        <?php 
echo widget('Admin.Common')->footer();
?>
            
        </div>
    </div>
<?php 
echo widget('Admin.Common')->htmlend();
开发者ID:mikegit2014,项目名称:laravelback,代码行数:30,代码来源:classify.blade.php


示例10: display_widgets

 /**
  *    视图回调函数[显示小挂件]
  *
  *    @author    Garbin
  *    @param     array $options
  *    @return    void
  */
 function display_widgets($options)
 {
     $area = isset($options['area']) ? $options['area'] : '';
     $page = isset($options['page']) ? $options['page'] : '';
     if (!$area || !$page) {
         return;
     }
     include_once ROOT_PATH . '/includes/widget.base.php';
     /* 获取该页面的挂件配置信息 */
     $widgets = get_widget_config($this->_get_template_name(), $page);
     /* 如果没有该区域 */
     if (!isset($widgets['config'][$area])) {
         return;
     }
     /* 将该区域内的挂件依次显示出来 */
     foreach ($widgets['config'][$area] as $widget_id) {
         $widget_info = $widgets['widgets'][$widget_id];
         $wn = $widget_info['name'];
         $options = $widget_info['options'];
         $widget =& widget($widget_id, $wn, $options);
         $widget->display();
     }
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:30,代码来源:frontend.base.php


示例11: route

<div class="header">
   <div class="logo">微店管理系统</div>
     
   <div class="header-right">
     
     <i class="icon-user icon-white"></i> <a href="#"><?php 
echo $username;
?>
</a> 
     <i class="icon-edit icon-white"></i> <a href="javascript:;" data-dialog-id="modify-password" class="modify-password">修改密码</a> 
     <i class="icon-off icon-white"></i> <a id="modal-973558" href="<?php 
echo route('foundation.login.out');
?>
" role="button" >注销</a> 
   </div>
</div>
<?php 
echo widget('Admin.Common')->mpassword();
?>
<!-- 顶部 --> 
开发者ID:pfdtk,项目名称:bmsys,代码行数:20,代码来源:top.blade.php


示例12: head

 public function head()
 {
     $this->config->load('fabtotum', TRUE);
     $this->load->helper('form');
     $this->load->helper('smart_admin_helper');
     $_units = json_decode(file_get_contents($this->config->item('fabtotum_config_units', 'fabtotum')), TRUE);
     if (isset($_units['settings_type']) && $_units['settings_type'] == 'custom') {
         $_units = json_decode(file_get_contents($this->config->item('fabtotum_custom_config_units', 'fabtotum')), TRUE);
     }
     $data['units'] = $_units;
     $data['heads_list'] = array_merge(array('head_shape' => '---'), $this->config->item('heads_list', 'fabtotum'), array('more_heads' => 'Get more heads'));
     $data['heads_descriptions'] = $this->config->item('heads_descriptions', 'fabtotum');
     $data['head'] = isset($_units['hardware']['head']['type']) ? $_units['hardware']['head']['type'] : 'head_shape';
     $widget_config['data-widget-icon'] = 'fa fa-toggle-down';
     $widget = widget('heads' . time(), 'Heads', $widget_config, $this->load->view('head/widget', $data, TRUE), false, true, false);
     $data['widget'] = $widget;
     $this->layout->add_js_in_page(array('data' => $this->load->view('head/js', $data, TRUE), 'comment' => ''));
     $this->layout->view('head/index', $data);
 }
开发者ID:tjankovic,项目名称:FAB-UI,代码行数:19,代码来源:maintenance.php


示例13: ls

 /**
  * 评论的列表,用于异步加载
  */
 public function ls()
 {
     $objectId = (int) Request::input('objectid');
     $view = widget('Home.Common')->comment($objectId);
     return response($view);
 }
开发者ID:mikegit2014,项目名称:laravelback,代码行数:9,代码来源:CommentController.php


示例14: css

<?php

css(theme_url() . '/css/fix.css');
widget('cycle', array('tag' => '#cycle', 'options' => array('pager' => '#cycle_pager', 'timeout' => 1000)));
widget('cycle', array('tag' => '#cycle2', 'options' => array('pager' => '#cycle_pager2', 'timeout' => 0)));
foreach ($posts as $p) {
    echo $p->id . '<br>';
}
$this->widget('LinkPager', array('pages' => $pages));
exit;
?>
 
<div class="middle">
        	<div class="one">
            	<div class="oneleft">
                    <p class="leftxin"><img src="<?php 
echo theme_url();
?>
/images/xiang.png" width="337" height="343" /></p>
                	<ul class="onelist">
                    	<li>
                        	<p class="col"><a href="#">10,000 success students</a></p>
                            <p class="colone"><a href="#">word of mouth reputation</a></p>
                        </li>
                        <li>
                        	<p class="col"><a href="#">200 professional Chinese teaching team</a></p>
                            <p class="colone"><a href="#">providing high quality language service</a></p>
                        </li>
                        <li>
                        	<p class="col"><a href="#">10 years experience in teaching Chinese</a></p>
                            <p class="colone"><a href="#">as a second language</a></p>
开发者ID:hiproz,项目名称:mincms,代码行数:31,代码来源:index.php


示例15: widget

    <?php 
}
?>
    <!--End. Block Accessories-->
</div>
<!-- End. Tabs block-->
<!--Start. Payments method form -->

<!--End. Payments method form -->
</div>

</div>
</div>
<!-- Start. Similar Products-->
<?php 
echo widget('similar');
?>
<!-- End. Similar Products-->
</div>


<!-- Start. Photo Popup Frame-->
<div class="drop drop-style globalFrameProduct" id="photo"></div>
</div>
<script type="text/template" id="framePhotoProduct">
<button type="button" class="icon_times_drop" data-closed="closed-js"></button>
<div class="drop-header">
<div class="title"><%- obj.title %></div>
<div class="horizontal-carousel">
<div class="frame-fancy-gallery frame-thumbs">
<div class="fancy-gallery carousel-js-css">
开发者ID:NavaINT1876,项目名称:skidka,代码行数:31,代码来源:3c5b29bcdf51d2d75687f9f8762f2c9b.php


示例16: widget

<!DOCTYPE html>
<html>
<head>
	<title>Widget Samlpe</title>
</head>
<body>

<div>
	Here is `views/sample/index.php`.
</div>

<div>
	<?php 
echo widget('Blog_widget::list_latest');
?>
</div>

</body>
</html>
开发者ID:kenjis,项目名称:codeigniter-widgets,代码行数:19,代码来源:index.php


示例17: config_widget

 /**
  *    配置挂件
  *
  *    @author    Garbin
  *    @param    none
  *    @return    void
  */
 function config_widget()
 {
     if (!IS_POST) {
         return;
     }
     $name = !empty($_GET['name']) ? trim($_GET['name']) : null;
     $id = !empty($_GET['id']) ? trim($_GET['id']) : null;
     /* 当前所编辑的页面 */
     $page = !empty($_GET['page']) ? trim($_GET['page']) : null;
     if (!$name || !$id || !$page) {
         $this->_config_respond('_d.setTitle("' . Lang::get('no_such_widget') . '");_d.setContents("message", {text:"' . Lang::get('no_such_widget') . '"});');
         return;
     }
     $page_config = get_widget_config(Conf::get('template_name'), $page);
     $widget =& widget($id, $name, $page_config['widgets'][$id]['options']);
     $options = $widget->parse_config($_POST);
     if ($options === false) {
         $this->json_error($widget->get_error());
         return;
     }
     $page_config['tmp'][$id]['options'] = $options;
     /* 保存配置信息 */
     $this->_save_page_config(Conf::get('template_name'), $page, $page_config);
     /* 返回即时更新的数据 */
     $widget->set_options($options);
     $contents = $widget->get_contents();
     $this->_config_respond('DialogManager.close("config_dialog");parent.disableLink(parent.$(document.body));parent.$("#' . $id . '").replaceWith(document.getElementById("' . $id . '").parentNode.innerHTML);parent.init_widget("#' . $id . '");', $contents);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:35,代码来源:template.app.php


示例18: widget

	  <div class="form-group">
	    <label >url</label>
	    <input type="input" class="form-control"  value="<?php 
    echo $data->slug;
    ?>
" name='slug' >
	  </div>
	
	  <div class="form-group">
	    <label>附件</label>
	  	<?php 
    widget('JUI');
    widget('Plupload', ['ele' => 'file', 'option' => ['CKEDITOR' => 'body', 'maxSize' => '30', 'class' => 'upload', 'count' => 100, 'data' => $data->file]]);
    ?>
		<?php 
    widget('ckeditor', ['ele' => 'body']);
    ?>
       
	  </div>
	  
	  <br style="clear:both;">
	  <div class="form-group">
	    <label>状态</label>
	    
	    <?php 
    $status = [1 => '启用', 0 => '禁用'];
    ?>
	    <p>
	    <select name="status" class="select">
	    <?php 
    $true = false;
开发者ID:sunkangtaichi,项目名称:PHPAPPLISTION_START,代码行数:31,代码来源:index.php


示例19: widget

				<section>
					<?php 
widget('top_box2', 'h2');
?>
				</section>
			
				<section>
					<h2>About being Qool</h2>
					<div class="6u-first">
						<?php 
widget('top_box3', 'h2');
?>
					</div>
					<div class="6u">
						<?php 
widget('top_box4', 'h2');
?>
					</div>
				</section>
				
			</div>
			<div class="8u">

				<section class="right-content">
					<h2><?php 
the('title');
?>
</h2>
					<?php 
the('content');
?>
开发者ID:basdog22,项目名称:Qool,代码行数:31,代码来源:view.php


示例20: url

        
        
        
        <script src="<?php 
echo url('/misc/app.js');
?>
"></script>
        <script src="<?php 
echo theme_url('/js/js.js');
?>
"></script>
        
        
        <?php 
widget('BootstrapSwitch');
widget('Select2', ['option' => []]);
?>
        <?php 
widget_render();
?>
        <?php 
echo $this->view['footer'];
?>
        
        
      
    </body>
    
</html>
<?php 
if (!is_ajax()) {
开发者ID:sunkangtaichi,项目名称:PHPAPPLISTION_START,代码行数:28,代码来源:main.layout.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP widget_unique_identifier函数代码示例发布时间:2022-05-23
下一篇:
PHP whoami函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap