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


PHP Get::state_field方法代码示例

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


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

示例1: array

<?php

$fields = Get::state_field($segment);
Weapon::fire('unit_composer_3_before', array($segment, $fields));
if (!isset($default->fields)) {
    $default->fields = array();
}
if (!empty($fields)) {
    $html = "";
    $field = Guardian::wayback('fields', Mecha::A($default->fields));
    foreach ($fields as $key => $value) {
        // <= 1.1.3
        // "" is equal to `article,page`
        // '*' is equal to all scopes
        if ($value['scope'] === "") {
            $value['scope'] = 'article,page';
        }
        if ($value['scope'] === '*') {
            $value['scope'] = $segment;
        }
        if (isset($field[$key]['type'])) {
            $field[$key] = isset($field[$key]['value']) ? $field[$key]['value'] : "";
        }
        $type = $value['type'][0];
        if (strpos(',' . $value['scope'] . ',', ',' . $segment . ',') !== false) {
            $description = isset($value['description']) && trim($value['description']) !== "" ? ' <span class="text-info help" title="' . Text::parse($value['description'], '->encoded_html') . '">' . Jot::icon('question-circle') . '</span>' : "";
            $title = $value['title'] . $description;
            $html .= Form::hidden('fields[' . $key . '][type]', $type);
            if ($type === 't') {
                $html .= '<label class="grid-group grid-group-text">';
                $html .= '<span class="grid span-2 form-label">' . $title . '</span>';
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:unit.composer.3.php

示例2: array

<?php

// Get field(s) ...
$fields = Get::state_field(null, array(), false);
/**
 * Field Manager
 * -------------
 */
Route::accept($config->manager->slug . '/field', function () use($config, $speak, $fields) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    Config::set(array('page_title' => $speak->fields . $config->title_separator . $config->manager->title, 'cargo' => 'cargo.field.php'));
    Shield::lot(array('segment' => 'field', 'files' => !empty($fields) ? Mecha::O($fields) : false))->attach('manager');
});
/**
 * Field Repairer/Igniter
 * ----------------------
 */
Route::accept(array($config->manager->slug . '/field/ignite', $config->manager->slug . '/field/repair/key:(:any)'), function ($key = false) use($config, $speak, $fields) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    if ($key === false) {
        Weapon::add('SHIPMENT_REGION_BOTTOM', function () {
            echo '<script>(function($){$.slug(\'title\',\'key\',\'_\')})(DASHBOARD.$);</script>';
        }, 11);
        $data = array('key' => false, 'title' => "", 'type' => 't', 'placeholder' => "", 'value' => "", 'description' => "", 'scope' => 'article');
        $title = Config::speak('manager.title_new_', $speak->field) . $config->title_separator . $config->manager->title;
    } else {
        if (!isset($fields[$key])) {
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.field.php

示例3: array

$hooks = array($files, $segment);
?>
<div class="main-action-group">
  <?php 
Weapon::fire('main_action_before', $hooks);
?>
  <?php 
echo Jot::btn('begin:plus-square', Config::speak('manager.title_new_', $speak->field), $config->manager->slug . '/field/ignite');
?>
  <?php 
Weapon::fire('main_action_after', $hooks);
?>
</div>
<?php 
echo $messages;
$files_all = Get::state_field(null, array());
ksort($files_all);
if ($files_all) {
    ?>
<table class="table-bordered table-full-width">
  <thead>
    <tr>
      <th><?php 
    echo $speak->title;
    ?>
</th>
      <th><?php 
    echo $speak->key;
    ?>
</th>
      <th><?php 
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:cargo.field.php

示例4: array

<?php

$fields = Get::state_field(null, array(), true, $segment);
if (!empty($fields)) {
    $html = "";
    $field = Guardian::wayback('fields', Mecha::A($page->fields_raw));
    $_ = 'unit:' . time() . '--';
    foreach ($fields as $key => $value) {
        if (isset($field[$key]['type'])) {
            // `POST` request
            $field[$key] = isset($field[$key]['value']) ? $field[$key]['value'] : "";
        }
        $type = $value['type'];
        if (!isset($value['scope']) || strpos(',' . $value['scope'] . ',', ',' . $segment . ',') !== false) {
            $description = isset($value['description']) && trim($value['description']) !== "" ? ' ' . Jot::info($value['description']) : "";
            $title = $value['title'] . $description;
            $html .= Form::hidden('fields[' . $key . '][type]', $type);
            if ($type === 'hidden' || $type === 'h') {
                $html .= Form::hidden('fields[' . $key . '][value]', isset($field[$key]) ? $field[$key] : $value['value']);
            } else {
                if ($type === 'text' || $type === 't') {
                    $html .= '<label class="grid-group grid-group-text">';
                    $html .= '<span class="grid span-2 form-label">' . $title . '</span>';
                    $html .= '<span class="grid span-4">';
                    $html .= Form::text('fields[' . $key . '][value]', Converter::toText(isset($field[$key]) ? $field[$key] : $value['value']), Converter::toText(isset($value['placeholder']) ? $value['placeholder'] : $value['value']), array('class' => 'input-block'));
                    $html .= '</span>';
                    $html .= '</label>';
                } else {
                    if ($type === 'boolean' || $type === 'b') {
                        $html .= '<div class="grid-group grid-group-boolean">';
                        $html .= '<span class="grid span-2"></span>';
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:fields[].php


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