當前位置: 首頁>>代碼示例>>PHP>>正文


PHP widget函數代碼示例

本文整理匯總了PHP中widget函數的典型用法代碼示例。如果您正苦於以下問題:PHP widget函數的具體用法?PHP widget怎麽用?PHP widget使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了widget函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的widget函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。