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


PHP label函数代码示例

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


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

示例1: ips

/**
 * widget function
 * works for select menus and some input fields
 * @param string $title 
 * @param string $function 
 * @param string $name 
 * @param string $value 
 * @param string $attr 
 * @param string $type 
 * @param string $subtitle 
 * @param string $req 
 * @param string $tag 
 * @param string $tag_attr 
 * @param string $extra 
 * @param string $afterwards 
 * @return string
 * @author edited by Peng Wang <peng@pengxwang.com>
 */
function ips($title, $function, $name, $value = '', $attr = '', $type = '', $subtitle = '', $req = '', $tag = '', $tag_attr = '', $extra = '', $afterwards = '')
{
    $OBJ =& get_instance();
    global $error_msg, $go;
    // set a default
    // we might want div later
    if (!$tag) {
        $tag = 'label';
    }
    $tag_attr ? $tag_attr = "{$tag_attr}" : ($tag_attr = '');
    $OBJ->access->prefs['user_help'] == 1 ? $help = showHelp($title) : ($help = '');
    $afterwards ? $afterwards = $afterwards : ($afterwards = '');
    if (isset($error_msg[$name])) {
        $msg = span($error_msg[$name], "class='error'");
    } else {
        $msg = null;
    }
    $subtitle ? $subtitle = span($subtitle, "class='small-txt'") : ($subtitle = '');
    $title ? $title = label($title . ' ' . $subtitle . ' ' . $help . $msg) : ($title = '');
    $req ? $req = showerror($msg) : ($req = '');
    $extra ? $add = $extra : ($add = '');
    $value = showvalue($name, $value);
    if ($function === 'input') {
        $function = input($name, $type, attr($attr), $value);
    } else {
        $function ? $function = $function($value, $name, attr($attr), $add) : ($function = null);
    }
    return $title . "\n" . $function;
}
开发者ID:WurdahMekanik,项目名称:hlf-ndxz,代码行数:47,代码来源:html.php

示例2: ctrl_input_field

function ctrl_input_field($errors, $inputType, $isRequired, $name, $labelText, $className, $originalValue = null)
{
    $divClassName;
    if ('REQUIRED' == $isRequired) {
        $divClassName = 'requiredField';
    } else {
        $divClassName = 'optionalField';
    }
    echo "<div class = '{$divClassName}'>";
    $value;
    if (sent_value($name) != null) {
        $value = sent_value($name);
    } else {
        $value = $originalValue;
    }
    if ('hidden' != $inputType) {
        //checkboxes look better if the box is on the left
        if ('checkbox' != $inputType) {
            label($name, $labelText);
            echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>";
        } else {
            echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>";
            label($name, $labelText);
        }
        error_label($errors, $name);
    } else {
        //hidden fields don't have labels or error labels
        echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>";
    }
    echo '</div>';
}
开发者ID:sagarb09,项目名称:Property-Management-Application,代码行数:31,代码来源:formControls.php

示例3: tablaDescarga

 public function tablaDescarga()
 {
     if (isset($_POST['miHtml'])) {
         $htmlEntrada = $_POST['miHtml'];
         $titulo = $_POST['titulo'];
         $str = $htmlEntrada;
         $table = str_get_html($str);
         $rowData = array();
         foreach ($table->find('tr') as $row) {
             // initialize array to store the cell data from each row
             $flight = array();
             foreach ($row->find('td') as $cell) {
                 // push the cell's text to the array
                 $flight[] = trim($cell->plaintext);
             }
             $rowData[] = $flight;
         }
         error_reporting(E_ALL);
         ini_set('display_errors', TRUE);
         ini_set('display_startup_errors', TRUE);
         // date_default_timezone_set('Europe/London');
         if (PHP_SAPI == 'cli') {
             die('This example should only be run from a Web Browser');
         }
         $objPHPExcel = new PHPExcel();
         $objPHPExcel->getProperties()->setCreator(label('nombreSistema'))->setLastModifiedBy(label('nombreSistema'));
         // ->setSubject("Prueba de descarga de tabla de personas")
         // ->setDescription("Documento de prueba de descarga de tabla de excel desde PHP")
         // ->setKeywords("office 2007 openxml php")
         // ->setCategory("Documento de prueba");
         $hoja = $objPHPExcel->getSheet(0);
         $hoja->setTitle($titulo);
         $hoja->fromArray($rowData, '', 'A1');
         $cantidadColumnas = count(array_shift($rowData));
         $abcd = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's');
         $ultimaColumna = $abcd[$cantidadColumnas - 1];
         $header = 'a1:' . $ultimaColumna . '1';
         $hoja->getStyle($header)->getFill()->setFillType(\PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FFFFFF00');
         $style = array('font' => array('bold' => true), 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER));
         $hoja->getStyle($header)->applyFromArray($style);
         for ($col = ord('a'); $col <= ord('z'); $col++) {
             $hoja->getColumnDimension(chr($col))->setAutoSize(true);
         }
         header('Content-Type: application/vnd.ms-excel');
         header('Content-Disposition: attachment;filename="' . $titulo . '.xls"');
         header('Cache-Control: max-age=0');
         header('Cache-Control: max-age=1');
         // header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
         header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
         // always modified
         header('Cache-Control: cache, must-revalidate');
         // HTTP/1.1
         header('Pragma: public');
         // HTTP/1.0
         $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
         $objWriter->save('php://output');
         exit;
     }
 }
开发者ID:brayanNunez,项目名称:touch,代码行数:59,代码来源:ManejadorExcel.php

示例4: uriboot

function uriboot($label, $uri, $args)
{
    label($label);
    echo "  kernel " . $uri . "\n";
    if ($args) {
        echo "  append " . $args . "\n";
    }
}
开发者ID:xtha,项目名称:salt,代码行数:8,代码来源:boot.php

示例5: render_meta_box

function render_meta_box($post)
{
    $templates = Template::getTodosArray();
    $select = input_select_simples('id_template', "Template de Evento", $templates);
    echo label("template", "Template de Evento", $select);
    $input = input_texto_simples('post_title', 'Título do Evento', 30);
    echo label("titulo", "Título do Evento", $input);
}
开发者ID:TiagoGouvea,项目名称:event-manager-plugin-wordpress,代码行数:8,代码来源:AdminEvento_NovoEvento.php

示例6: message

/**
 * Created by PhpStorm.
 * User: Shunichiro AKI
 * Date: 2015/09/18
 * Time: 23:19
 */
function message($id, $transParameters = [], $rawParameters = [])
{
    $mergeParameters = [];
    foreach ($transParameters as $key => $value) {
        $mergeParameters[$key] = label($value);
    }
    $mergeParameters += $rawParameters;
    return trans('messages.' . $id, $mergeParameters);
}
开发者ID:nana4rider,项目名称:mdiary,代码行数:15,代码来源:helper.php

示例7: add_field

function add_field($f, $id, $label = "", $req = false, $class = "", $type = "text")
{
    $in = make_tag("input", $class);
    $in["attribs"]["type"] = $type;
    $in["attribs"]["id"] = $id;
    $in["attribs"]["name"] = $id;
    $in["attribs"]["placeholder"] = $label;
    !$req || ($in["attribs"]["required"] = "");
    $f["children"][] = label($id, $label);
    $f["children"][] = $in;
    return $f;
}
开发者ID:AdeelH,项目名称:reddit-clone,代码行数:12,代码来源:html_funcs.php

示例8: compile

 private function compile(array $tokens)
 {
     $cg = (object) ['ts' => TokenStream::fromSlice($tokens), 'parsers' => []];
     traverse(rtoken('/^(T_\\w+)·(\\w+)$/')->onCommit(function (Ast $result) use($cg) {
         $token = $result->token();
         $id = $this->lookupCapture($token);
         $type = $this->lookupTokenType($token);
         $cg->parsers[] = token($type)->as($id);
     }), ($parser = chain(rtoken('/^·\\w+$/')->as('type'), token('('), optional(ls(either(future($parser)->as('parser'), chain(token(T_FUNCTION), parentheses()->as('args'), braces()->as('body'))->as('function'), string()->as('string'), rtoken('/^T_\\w+·\\w+$/')->as('token'), rtoken('/^T_\\w+$/')->as('constant'), rtoken('/^·this$/')->as('this'), label()->as('label'))->as('parser'), token(',')))->as('args'), commit(token(')')), optional(rtoken('/^·\\w+$/')->as('label'), null)))->onCommit(function (Ast $result) use($cg) {
         $cg->parsers[] = $this->compileParser($result->type, $result->args, $result->label);
     }), $this->layer('{', '}', braces(), $cg), $this->layer('[', ']', brackets(), $cg), $this->layer('(', ')', parentheses(), $cg), rtoken('/^···(\\w+)$/')->onCommit(function (Ast $result) use($cg) {
         $id = $this->lookupCapture($result->token());
         $cg->parsers[] = layer()->as($id);
     }), token(T_STRING, '·')->onCommit(function (Ast $result) use($cg) {
         $offset = \count($cg->parsers);
         if (0 !== $this->dominance || 0 === $offset) {
             $this->fail(self::E_BAD_DOMINANCE, $offset, $result->token()->line());
         }
         $this->dominance = $offset;
     }), rtoken('/·/')->onCommit(function (Ast $result) {
         $token = $result->token();
         $this->fail(self::E_BAD_CAPTURE, $token, $token->line());
     }), any()->onCommit(function (Ast $result) use($cg) {
         $cg->parsers[] = token($result->token());
     }))->parse($cg->ts);
     // check if macro dominance '·' is last token
     if ($this->dominance === \count($cg->parsers)) {
         $this->fail(self::E_BAD_DOMINANCE, $this->dominance, $cg->ts->last()->line());
     }
     $this->specificity = \count($cg->parsers);
     if ($this->specificity > 1) {
         if (0 === $this->dominance) {
             $pattern = chain(...$cg->parsers);
         } else {
             /*
               dominat macros are partially wrapped in commit()s and dominance
               is the offset used as the 'event horizon' point... once the entry
               point is matched, there is no way back and a parser error arises
             */
             $prefix = array_slice($cg->parsers, 0, $this->dominance);
             $suffix = array_slice($cg->parsers, $this->dominance);
             $pattern = chain(...array_merge($prefix, array_map(commit::class, $suffix)));
         }
     } else {
         /*
           micro optimization to save one function call for every token on the subject
           token stream whenever the macro pattern consists of a single parser
         */
         $pattern = $cg->parsers[0];
     }
     return $pattern;
 }
开发者ID:lastguest,项目名称:yay,代码行数:52,代码来源:Pattern.php

示例9: echolabel

function echolabel($blockarr, $theblcokvalue)
{
    if (!empty($blockarr) && is_array($blockarr)) {
        foreach ($blockarr as $bkey => $bvalue) {
            if (!isset($bvalue['alang'])) {
                $bvalue['alang'] = '';
            }
            if (!isset($bvalue['options'])) {
                $bvalue['options'] = array();
            }
            if (!isset($bvalue['other'])) {
                $bvalue['other'] = '';
            }
            if (!isset($bvalue['text'])) {
                $bvalue['text'] = '';
            }
            if (!isset($bvalue['check'])) {
                $bvalue['check'] = '';
            }
            if (!isset($bvalue['radio'])) {
                $bvalue['radio'] = '';
            }
            if (!isset($bvalue['size'])) {
                $bvalue['size'] = '';
            }
            if (!isset($theblcokvalue[$bkey])) {
                $theblcokvalue[$bkey] = '';
            }
            if (!isset($bvalue['width'])) {
                $bvalue['width'] = '';
            }
            $labelarr = array('type' => $bvalue['type'], 'alang' => $bvalue['alang'], 'name' => $bkey, 'size' => $bvalue['size'], 'text' => $bvalue['text'], 'check' => $bvalue['check'], 'radio' => $bvalue['radio'], 'options' => $bvalue['options'], 'other' => $bvalue['other'], 'width' => $bvalue['width'], 'value' => $theblcokvalue[$bkey]);
            if ($bkey == 'order') {
                if (!isset($theblcokvalue['order'])) {
                    $theblcokvalue['order'] = '';
                }
                if (!isset($theblcokvalue['sc'])) {
                    $theblcokvalue['sc'] = '';
                }
                $labelarr['order'] = $theblcokvalue['order'];
                $labelarr['sc'] = $theblcokvalue['sc'];
            }
            echo label($labelarr);
        }
    }
}
开发者ID:cwcw,项目名称:cms,代码行数:46,代码来源:admin.func.php

示例10: typeAsLabel

 public function typeAsLabel()
 {
     // Grab the type
     $type = $this->type();
     switch ($type) {
         case 'info':
             $content = "Info";
             break;
         case 'warning':
             $content = "Warning";
             break;
         case 'danger':
             $content = "Critical";
             break;
     }
     return label($type, $content);
 }
开发者ID:anodyne,项目名称:xtras,代码行数:17,代码来源:ItemMessagePresenter.php

示例11: getValidatorInstance

 /**
  * @return \Illuminate\Contracts\Validation\Validator
  */
 protected function getValidatorInstance()
 {
     $validator = parent::getValidatorInstance();
     // 写真のバリデーション
     $validator->each('picture', 'image');
     $pictureKeys = $this->getPictureKeys();
     $attributeNames = [];
     foreach ($pictureKeys as $key) {
         $attributeNames['picture.' . $key] = label('picture');
     }
     $validator->setAttributeNames($attributeNames);
     $validator->after(function ($validator) use(&$pictureKeys) {
         $messages = $validator->messages();
         foreach ($pictureKeys as $key) {
             if ($messages->has('picture.' . $key)) {
                 // BootFormで表示できるよう、pictureにメッセージをコピー
                 $validator->errors()->add('picture', $messages->first('picture.' . $key));
                 return;
             }
         }
     });
     return $validator;
 }
开发者ID:nana4rider,项目名称:mdiary,代码行数:26,代码来源:TextDiaryUpsertRequest.php

示例12: label

    <h2>Envio de SMS</h2>

    <form method="post">
        <div id="poststuff">
            <div id="post-body" class="metabox-holder columns-2">
                <div id="post-body-content">
                    <div class="postbox-container">
                        <div class="postbox">
                            <h3 class="hndle"><span><?php 
echo $titulo;
?>
</span></h3>
                            <div class="inside">
                                <form method="post" action="">
                                <?php 
echo label('mensagem', 'Mensagem', input_textarea_simples('mensagem', 2, ''), "Variáveis disponíveis para utilização:<br>" . getVariaveis($event));
?>
                            </div>

                            <div id="major-publishing-actions">
                                <div id="publishing-action">
                                    <span class="spinner"></span>
                                    <input type="submit" name="publish" id="publish" class="button button-primary button-large" value="Enviar" accesskey="p"></div>
                                <div class="clear"></div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
开发者ID:TiagoGouvea,项目名称:event-manager-plugin-wordpress,代码行数:31,代码来源:form_sms.php

示例13: label

</p>
   </div>
   <div id="botonEliminar" class="modal-footer black-text">
      <a href="" class="waves-effect waves-red btn-flat modal-action modal-close"><?php 
echo label('aceptar');
?>
</a>
   </div>
</div>
<div id="eliminarFase" class="modal">
   <div class="modal-header">
      <p><?php 
echo label('nombreSistema');
?>
</p>
      <a class="modal-action modal-close cerrar-modal"><i class="mdi-content-clear"></i></a>
   </div>
   <div class="modal-content">
      <p><?php 
echo label('confirmarEliminarFase');
?>
</p>
   </div>
   <div id="botonEliminar" class="modal-footer black-text">
      <a href="" class="waves-effect waves-red btn-flat modal-action modal-close"><?php 
echo label('aceptar');
?>
</a>
   </div>
</div>
<!-- Fin lista modals -->
开发者ID:brayanNunez,项目名称:touch,代码行数:31,代码来源:servicios_editar.php

示例14: strtoupper

<?php

$string = "<!-- Main content -->\n        <section class='content'>\n          <div class='row'>\n            <div class='col-xs-12'>\n              <div class='box'>\n                <div class='box-header'>\n                \n                  <h3 class='box-title'>" . strtoupper($table_name) . "</h3>\n                      <div class='box box-primary'>";
$string .= "\n        <form action=\"<?php echo \$action; ?>\" method=\"post\">";
$string .= "<table class='table table-bordered'>";
foreach ($non_pk as $row) {
    if ($row["data_type"] == 'text') {
        $string .= "\n\t    <tr><td>" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></td>\n            <td><textarea class=\"form-control\" rows=\"3\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\"><?php echo \$" . $row["column_name"] . "; ?></textarea>\n        </td></tr>";
    } else {
        $string .= "\n\t    <tr><td>" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></td>\n            <td><input type=\"text\" class=\"form-control\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\" value=\"<?php echo \$" . $row["column_name"] . "; ?>\" />\n        </td>";
    }
}
$string .= "\n\t    <input type=\"hidden\" name=\"" . $pk . "\" value=\"<?php echo \$" . $pk . "; ?>\" /> ";
$string .= "\n\t    <tr><td colspan='2'><button type=\"submit\" class=\"btn btn-primary\"><?php echo \$button ?></button> ";
$string .= "\n\t    <a href=\"<?php echo site_url('" . $c_url . "') ?>\" class=\"btn btn-default\">Cancel</a></td></tr>";
$string .= "\n\t\n    </table></form>\n    </div><!-- /.box-body -->\n              </div><!-- /.box -->\n            </div><!-- /.col -->\n          </div><!-- /.row -->\n        </section><!-- /.content -->";
$hasil_view_form = createFile($string, $target . "views/" . $v_form_file);
开发者ID:nurisakbar,项目名称:racode,代码行数:17,代码来源:create_view_form.php

示例15: label

        </li>
        <li class="li-hover">
            <div class="divider"></div>
        </li>
        <?php 
if ($rolCotizador) {
    ?>
            <li class="li-hover"><p class="ultra-small margin more-text"><?php 
    echo label('masOpciones');
    ?>
 </p></li>
            <li>
                <a href="<?php 
    echo base_url();
    ?>
cotizacion/cotizar">
                    <i class="mdi-action-swap-vert-circle"></i><?php 
    echo label('agregarCotizacion');
    ?>
                </a>
            </li>
        <?php 
}
?>
    </ul>
    <a href="#" class="sidebar-collapse btn-floating btn-medium waves-effect waves-light hide-on-large-only darken-2"
       data-activates="slide-out">
        <i class="mdi-navigation-menu"></i>
    </a>
</aside>
<!-- END LEFT SIDEBAR NAV-->
开发者ID:brayanNunez,项目名称:touch,代码行数:31,代码来源:left-sidebar.php


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