本文整理汇总了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);
}
示例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);
}
}
示例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', []));
}
示例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));
}
示例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));
}
}
示例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
示例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>
示例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');
示例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();
示例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();
}
}
示例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();
?>
<!-- 顶部 -->
示例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);
}
示例13: ls
/**
* 评论的列表,用于异步加载
*/
public function ls()
{
$objectId = (int) Request::input('objectid');
$view = widget('Home.Common')->comment($objectId);
return response($view);
}
示例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>
示例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">