本文整理汇总了PHP中Widget::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::select方法的具体用法?PHP Widget::select怎么用?PHP Widget::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public static function render($page, $position = '')
{
$page = !$page ? 'null' : $page;
if (Cache::tags('widgets')->has($page . '-' . $position)) {
$merged = Cache::tags('widgets')->get($page . '-' . $position);
} else {
if ($page == 'null') {
$merged = Widget::select('id', 'title', 'content', 'path')->active()->global()->wherePosition($position)->orderBy('ordr', 'ASC')->get();
} else {
$global = Widget::select('id', 'title', 'content', 'path')->active()->global()->wherePosition($position)->orderBy('ordr', 'ASC')->get();
$specific = $page->widgets()->select('id', 'title', 'content', 'path')->local()->wherePosition($position)->orderBy('ordr', 'ASC')->get();
$merged = $global->merge($specific);
}
$merged->sortBy('ordr');
Cache::tags('widgets')->forever($page . '-' . $position, $merged);
}
foreach ($merged as $widget) {
if ($widget->path) {
if (\View::exists($widget->path)) {
echo view($widget->path);
}
} else {
echo str_replace('{{url}}', Request::url(), $widget->content);
}
}
}
示例2: data
/**
* Show a list of all the widgets formatted for Datatables.
*
* @return Datatables JSON
*/
public function data()
{
//Make this method testable and mockable by using our injected $widget member.
$widgets = $this->widget->select(array('widgets.id', 'widgets.name', 'widgets.description', 'widgets.created_at'));
return Datatables::of($widgets)->add_column('actions', '<div class="btn-group">
<button type="button" class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{{ URL::to(\'widgets/\' . $id ) }}}">{{{ Lang::get(\'button.show\') }}}</a></li>
<li><a href="{{{ URL::to(\'widgets/\' . $id . \'/edit\' ) }}}">{{{ Lang::get(\'button.edit\') }}}</a></li>
<li><a href="{{{ URL::to(\'widgets/\' . $id . \'/delete\' ) }}}">{{{ Lang::get(\'button.delete\') }}}</a></li>
</ul>
</div>')->remove_column('id')->make();
}
示例3: appendPreferences
public function appendPreferences($context) {
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(
new XMLElement('legend', 'markItUp Editor')
);
$options = array(
array('Markdown', General::sanitize($this->getFormatter()) == 'Markdown'),
array('Textile', General::sanitize($this->getFormatter()) == 'Textile')
);
$formatter = Widget::Label('Text Formatter');
$formatter->appendChild(Widget::select(
'settings[markitup][textformatter]', $options
));
$group->appendChild($formatter);
$context['wrapper']->appendChild($group);
}
示例4: __viewEdit
//.........这里部分代码省略.........
));
}
if (isset($this->_errors['source'])) {
$label = Widget::wrapFormElementWithError($label, $this->_errors['source']);
}
$fieldset->appendChild($label);
// Target --------------------------------------------------------------
$label = Widget::Label('Target');
$label->appendChild(Widget::Input(
'fields[target]',
General::sanitize($this->_fields['target'])
));
if (isset($this->_errors['target'])) {
$label = Widget::wrapFormElementWithError($label, $this->_errors['target']);
}
$fieldset->appendChild($label);
// Method -------------------------------------------------------------
$group = new XMLElement('div');
$group->setAttribute('class', 'redirectionmanager_group');
$input = Widget::Input(
'fields[method]', 'regexp', 'checkbox',
($this->_fields['method'] == 'regexp' ? array('checked' => 'checked') : null)
);
$input = $input->generate();
$label = Widget::Label("{$input} Use regular expressions?");
$group->appendChild($label);
$help = new XMLElement('p');
$help->setAttribute('class', 'help');
$help->setValue("
Use * as a wild-card unless regular expressions are enabled.
");
$group->appendChild($help);
$fieldset->appendChild($group);
$this->Form->appendChild($fieldset);
// Type --------------------------------------------------------------
$options = array(
array('301'),
array('302'),
array('307')
);
$label = Widget::Label('HTTP Type');
$label->appendChild(Widget::select(
'fields[type]', $options
));
if (isset($this->_errors['type'])) {
$label = Widget::wrapFormElementWithError($label, $this->_errors['type']);
}
$fieldset->appendChild($label);
// Save ---------------------------------------------------------------
$div = new XMLElement('div');
$div->setAttribute('class', 'actions');
$div->appendChild(
Widget::Input(
'action[save]', 'Save Changes', 'submit',
array(
'accesskey' => 's'
)
)
);
// Delete -------------------------------------------------------------
if ($this->_editing) {
$button = new XMLElement('button', 'Delete');
$button->setAttributeArray(array(
'name' => 'action[delete]',
'class' => 'confirm delete',
'title' => 'Delete this email'
));
$div->appendChild($button);
}
$this->Form->appendChild($div);
}
示例5: appendCondition
protected function appendCondition(Duplicator $duplicator, $condition = array())
{
$document = $duplicator->ownerDocument;
if (empty($condition)) {
$item = $duplicator->createTemplate(__('Don\'t Execute When'));
} else {
$item = $duplicator->createInstance(__('Don\'t Execute When'));
}
if (!isset($condition['parameter'])) {
$condition['parameter'] = null;
}
if (!isset($condition['logic'])) {
$condition['logic'] = 'empty';
}
$group = $document->createElement('div');
$group->setAttribute('class', 'group double');
// Parameter
$label = $document->createElement('label', __('Parameter'));
$label->appendChild(Widget::input('fields[conditions][parameter][]', $condition['parameter']));
$group->appendChild($label);
// Logic
$label = $document->createElement('label', __('Logic'));
$label->appendChild(Widget::select('fields[conditions][logic][]', array(array('empty', $condition['logic'] == 'empty', __('is empty')), array('set', $condition['logic'] == 'set', __('is set'))), array('class' => 'filtered')));
$group->appendChild($label);
$group->appendChild($label);
$item->appendChild($group);
}
示例6: index
//.........这里部分代码省略.........
$Div->setAttribute('class', 'group');
## fields[database][host]
$Div->addChild(Widget::label('Host', Widget::input('fields[database][host]', $fields['database']['host'])));
## fields[database][port]
$Div->addChild(Widget::label('Port', Widget::input('fields[database][port]', $fields['database']['port'])));
$Fieldset->addChild($Div);
$class = NULL;
if (defined('kDATABASE_PREFIX_WARNING') && kDATABASE_PREFIX_WARNING == true) {
$class = 'warning';
}
## fields[database][prefix]
$Fieldset->addChild(Widget::label('Table Prefix', Widget::input('fields[database][prefix]', $fields['database']['prefix']), $class));
if (defined('ERROR') && defined('kDATABASE_PREFIX_WARNING')) {
$Fieldset->addChild(Widget::warning($warnings[ERROR]));
}
$Page->setTemplateVar('TABLE-PREFIX', $fields['database']['prefix']);
## fields[database][high-compatibility]
$Fieldset->addChild(Widget::label('Use compatibility mode', Widget::input('fields[database][high-compatibility]', 'yes', NULL, 'checkbox'), 'option'));
$Fieldset->addChild(new XMLElement('p', 'Symphony normally specifies UTF-8 character encoding for database entries. With compatibility mode enabled, Symphony will instead use the default character encoding of your database.'));
$Database->addChild($Fieldset);
$Form->addChild($Database);
/** END DATABASE SETTINGS **/
/**
*
* START PERMISSION SETTINGS
*
**/
/*
<fieldset>
<legend>Permission Settings</legend>
<p>Symphony needs permission to read and write both files and directories.</p>
<div class="group">
<label>Files
<select name="">
<option value="0777">0777</option>
</select>
</label>
<label>Directories
<select name="">
<option value="0777">0777</option>
</select>
</label>
</div>
</fieldset>
*/
$Permissions = new XMLElement('fieldset');
$Permissions->addChild(new XMLElement('legend', 'Permission Settings'));
$Permissions->addChild(new XMLElement('p', 'Symphony needs permission to read and write both files and directories.'));
$Div = new XMLElement('div');
$Div->setAttribute('class', 'group');
## fields[permission][file]
$Div->addChild(Widget::label('Files', Widget::select('fields[permission][file]', array('0777', '0775', '0755', '0666', '0644', '0444'), $fields['permission']['file'])));
## fields[permission][directory]
$Div->addChild(Widget::label('Directories', Widget::select('fields[permission][directory]', array('0777', '0775', '0755', '0666', '0644', '0444'), $fields['permission']['directory'])));
$Permissions->addChild($Div);
$Form->addChild($Permissions);
/** END PERMISSION SETTINGS **/
/**
*
* START USER SETTINGS
*
**/
/*
<fieldset>
<legend>User Information</legend>
<p>Once installed, you will be able to login to the Symphony admin with these user details.</p>