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


PHP validater::checkCode方法代码示例

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


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

示例1: strtoupper

                if (validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 1, 1))) {
                    $rightName .= strtoupper(substr($name, 1, 1));
                }
                ?>
              <?php 
                if (validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 1, 1))) {
                    $rightName .= strtoupper(substr($name, 1, 3));
                }
                ?>
              <?php 
                if (!validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 3, 1))) {
                    $rightName .= strtoupper(substr($name, 3, 1));
                }
                ?>
              <?php 
                if (!validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 3, 1))) {
                    $rightName .= substr($name, 3, 3);
                }
                ?>
              <i class='icon icon-default' style="background-color: hsl(<?php 
                echo $right['id'] * 47 % 360;
                ?>
, 100%, 40%)"> <span><?php 
                echo $rightName;
                ?>
 </span></i>
              <?php 
            }
            ?>
              <?php 
            echo html::checkbox('apps', array($code => $right['name']), $right['right'] == '1' ? $code : '');
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:manageapppriv.html.php

示例2: printBlock

 /**
  * Print block. 
  * 
  * @param  int    $index 
  * @access public
  * @return void
  */
 public function printBlock($index)
 {
     $block = $this->block->getBlock($index);
     if (empty($block)) {
         return false;
     }
     $html = '';
     if ($block->block == 'html') {
         $html = "<div class='article-content'>" . htmlspecialchars_decode($block->params->html) . '</div>';
     } elseif ($block->block == 'rss') {
         $html = $this->block->getRss($block);
     } elseif ($block->source != '') {
         $html = $this->block->getEntry($block);
     } elseif ($block->block == 'allEntries') {
         $entries = $this->loadModel('entry')->getEntries();
         $html = "<div id='allEntriesBlock' class='all-entries'><table class='table'><tr>";
         foreach ($entries as $entry) {
             $class = !$entry->buildin ? "class='iframe'" : '';
             $size = $entry->size != 'max' ? json_decode($entry->size) : '';
             $width = isset($size->width) ? "width={$size->width}" : '';
             $height = isset($size->height) ? "height={$size->height}" : '';
             $image = html::image($entry->logo, "width=18");
             if (!$entry->logo) {
                 $hue = $entry->id * 47 % 360;
                 $name = $entry->abbr ? $entry->abbr : $entry->name;
                 $entryName = validater::checkCode(substr($name, 0, 1)) ? strtoupper(substr($name, 0, 1)) : substr($name, 0, 3);
                 if (validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 1, 1))) {
                     $entryName .= strtoupper(substr($name, 1, 1));
                 }
                 if (validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 1, 1))) {
                     $entryName .= strtoupper(substr($name, 1, 3));
                 }
                 if (!validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 3, 1))) {
                     $entryName .= strtoupper(substr($name, 3, 1));
                 }
                 if (!validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 3, 1))) {
                     $entryName .= substr($name, 3, 3);
                 }
                 $image = "<i class='icon icon-default' style='background-color: hsl({$hue}, 100%, 40%)'> <span>" . $entryName . "</span></i> ";
             }
             $html .= "<td class='pull-left' width='33%'>" . html::a($entry->login, $image . $entry->name, "{$class} {$width} {$height}") . "</td>";
         }
         $html .= "</tr></table></div>";
     } elseif ($block->block == 'dynamic') {
         $html = $this->fetch('block', 'dynamic');
     }
     die($html);
 }
开发者ID:leowh,项目名称:colla,代码行数:55,代码来源:control.php


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