• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP o函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getEventsByTarget

 static function getEventsByTarget($deviceDS)
 {
     $where = array('e_code LIKE ?', 'e_code LIKE ?', 'e_code LIKE ?');
     $searchPatterns = array('%' . $deviceDS['d_id'] . '%', '%' . @first($deviceDS['d_alias'], 'NOMATCH') . '%');
     return o(db)->get('SELECT * FROM #events WHERE
     ' . implode(' OR ', $where), $searchPatterns);
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:7,代码来源:H2EventManager.php


示例2: render

 public function render()
 {
     if (!$this->value_is_valid) {
         $this->attribute("ERROR");
     }
     $output = "<div class='form-element-wrapper'>";
     if ($this->label && $this->attributes['id']) {
         $output .= "<span id='" . o($this->attributes['id']) . "'>" . o($this->label) . ": </span>";
     }
     $output .= "<span " . $this->getAttributeString() . ">";
     foreach ($this->options as $value => $option) {
         $option = o($option);
         $value = o($value);
         $output .= "<span class='form-element-radio-option'>";
         if ($option) {
             $output .= "<label for='" . o($this->attributes['id']) . "-{$value}'>{$option}: </label>";
         }
         if ($value == $this->selected_option) {
             $output .= "<input type='radio' name='" . o($this->name) . "' id='" . o($this->attributes['id']) . "-{$value}' value='{$value}' checked='checked' />";
         } else {
             $output .= "<input type='radio' name='" . o($this->name) . "' id='" . o($this->attributes['id']) . "-{$value}' value='{$value}' />";
         }
         $output .= "</span>";
     }
     $output .= "</span>";
     $output .= "</div>";
     return $output;
 }
开发者ID:FatBoyXPC,项目名称:worldcubeassociation.org,代码行数:28,代码来源:Radio.class.php


示例3: showBody

function showBody()
{
    #----------------------------------------------------------------------
    global $chosenPersonId;
    // simple validation first...
    if (!preg_match('/\\d{4}\\w{4}\\d{2}/', $chosenPersonId)) {
        showErrorMessage('Invalid WCA id Format <strong>[</strong>' . o($chosenPersonId) . '<strong>]</strong>');
        print '<p><a href="persons.php">Click here to search for people.</a></p>';
        return;
    }
    #--- Get all incarnations of the person.
    $persons = dbQuery("\n    SELECT person.name personName, country.name countryName, day, month, year, gender\n    FROM Persons person, Countries country\n    WHERE person.id = '{$chosenPersonId}' AND country.id = person.countryId\n    ORDER BY person.subId\n  ");
    #--- If there are none, show an error and do no more.
    if (!count($persons)) {
        showErrorMessage('Unknown person id <strong>[</strong>' . o($chosenPersonId) . '<strong>]</strong>');
        $namepart = substr($chosenPersonId, 4, 4);
        print '<p><a href="persons.php?pattern=' . urlEncode($namepart) . '">Click to search for people with `' . o($namepart) . '` in their name.</a></p>';
        return;
    }
    #--- Get and show the current incarnation.
    $currentPerson = array_shift($persons);
    extract($currentPerson);
    echo "<h1>{$personName}</h1>";
    #--- Show previous incarnations if any.
    if (count($persons)) {
        echo "<p class='subtitle'>(previously ";
        foreach ($persons as $person) {
            $previous[] = "{$person['personName']}/{$person['countryName']}";
        }
        echo implode(', ', $previous) . ")</p>";
    }
    #--- Show the picture if any.
    $picture = getCurrentPictureFile($chosenPersonId);
    if ($picture) {
        echo "<center><img class='person' src='{$picture}' /></center>";
    }
    #--- Show the In Memoriam if any.
    $inMemoriamArray = array("2008COUR01" => "https://www.worldcubeassociation.org/forum/viewtopic.php?t=2028", "2003LARS01" => "https://www.worldcubeassociation.org/forum/viewtopic.php?t=1982", "2012GALA02" => "https://www.worldcubeassociation.org/forum/viewtopic.php?t=1044", "2008LIMR01" => "https://www.worldcubeassociation.org/forum/viewtopic.php?t=945", "2008KIRC01" => "https://www.worldcubeassociation.org/forum/viewtopic.php?t=470");
    if (array_key_exists($chosenPersonId, $inMemoriamArray)) {
        echo "<center><a target='_blank' href='{$inMemoriamArray[$chosenPersonId]}'>In Memoriam</a></center>";
    }
    #--- Show the details.
    tableBegin('results', 4);
    tableCaption(false, 'Details');
    tableHeader(explode('|', 'Country|WCA Id|Gender|Competitions'), array(3 => 'class="f"'));
    $gender_text = genderText($gender);
    $numberOfCompetitions = dbValue("SELECT count(distinct competitionId) FROM Results where personId='{$chosenPersonId}'");
    tableRow(array($countryName, $chosenPersonId, $gender_text, $numberOfCompetitions));
    tableEnd();
    #--- Try the cache for the results
    # tryCache( 'person', $chosenPersonId );
    #--- Now the results.
    require 'includes/person_personal_records_current.php';
    require 'includes/person_world_championship_podiums.php';
    require 'includes/person_world_records_history.php';
    require 'includes/person_continent_records_history.php';
    require 'includes/person_events.php';
}
开发者ID:FatBoyXPC,项目名称:worldcubeassociation.org,代码行数:58,代码来源:person.php


示例4: ajax_getstate

 function ajax_getstate()
 {
     $r = array();
     foreach (o(db)->get('SELECT * FROM devices
   ORDER BY d_room, d_key') as $d) {
         $r['d' . $d['d_id']] = array('id' => $d['d_id'], 'state' => $d['d_state'], 'd_name' => $d['d_name']);
     }
     print json_encode($r);
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:9,代码来源:svc.controller.php


示例5: getData

 function getData()
 {
     $this->fields = o(db)->fields($this->props['table']);
     $this->prepareFieldProperties();
     if (sizeof($this->props['cols']) == 0) {
         $this->makeAutoColumns();
     }
     $this->data = o(db)->get('SELECT * FROM ?', array('$' . $this->props['table']));
     return $this;
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:10,代码来源:H2Table.php


示例6: render

 public function render()
 {
     $output = parent::render();
     $output .= "<div class='form-element-wrapper'>";
     if ($this->label && $this->attributes['id']) {
         $output .= "<label for='" . o($this->attributes['id']) . "'>" . o($this->label) . ": </label>";
     }
     $output .= "<input" . $this->getAttributeString() . "/>";
     $output .= "</div>";
     return $output;
 }
开发者ID:FatBoyXPC,项目名称:worldcubeassociation.org,代码行数:11,代码来源:Input.class.php


示例7: getGroupsByDevice

 static function getGroupsByDevice($deviceDS)
 {
     $matchingGroups = array();
     foreach (o(db)->get('SELECT * FROM #nvstore WHERE nv_key LIKE "group/%" ORDER BY nv_key') as $grpData) {
         $gName = $grpData['nv_key'];
         CutSegment('/', $gName);
         $gList = json_decode($grpData['nv_data']);
         if (is_array($gList) && array_search($deviceDS['d_key'], $gList) !== false) {
             $matchingGroups[] = $gName;
         }
     }
     return $matchingGroups;
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:13,代码来源:H2GroupManager.php


示例8: newRow

 public function newRow($data = array())
 {
     $object = o(sha1(time() . $this->settings['entity'] . session_id() . Utils::token()));
     $object->thin_litedb = $this;
     $object->id = null;
     if (count($data) && Arrays::isAssoc($data)) {
         foreach ($this->settings['modelFields'] as $field => $infos) {
             $value = ake($field, $data) ? $data[$field] : null;
             $object->{$field} = $value;
         }
     }
     return $object;
 }
开发者ID:schpill,项目名称:thin,代码行数:13,代码来源:Litedb.php


示例9: signin

    function signin()
    {
        if ($_POST['fid'] == sha1($_SESSION['fid'])) {
            $uds = o(db)->getDSMatch('accounts', array('a_username' => trim($_POST['username']), 'a_password' => sha1($_POST['password'])));
            if ($uds['a_key'] > 0) {
                WriteToFile('log/account.log', date('Y-m-d H:i:s') . ' (i) ' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ' : ' . $_SERVER['REMOTE_ADDR'] . ' sign in with ' . trim($_POST['username']) . '/***' . chr(10));
                $_SESSION['uid'] = $uds['a_key'];
                $_SESSION['ds'] = $uds;
                header('location: ./?');
                die;
            } else {
                WriteToFile('log/account.log', date('Y-m-d H:i:s') . ' (f) ' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ' : ' . $_SERVER['REMOTE_ADDR'] . ' sign in failed with ' . trim($_POST['username']) . '/***' . chr(10));
                ?>
<div style="text-align: center">Error signing in, try again.</div><?php 
            }
        } else {
            WriteToFile('log/account.log', date('Y-m-d H:i:s') . ' (a) ' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ' : ' . gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']) . ' signin page ' . chr(10));
        }
    }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:19,代码来源:accounts.controller.php


示例10: initController

 function initController($controllerName)
 {
     $controllerName = first($controllerName, cfg('service/defaultcontroller'));
     $this->controllerName = safeName($controllerName);
     $this->controllerFile = 'mvc/' . strtolower($this->controllerName) . '/' . strtolower($this->controllerName) . '.controller.php';
     if (!file_exists($this->controllerFile)) {
         header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
         header('Status: 404 Not Found');
         die('File not found at: ' . $_SERVER['REQUEST_URI'] . '<br/>Controller: ' . $this->controllerName);
     }
     require_once $this->controllerFile;
     $this->controllerClassName = $this->controllerName . 'Controller';
     $this->controller = o(new $this->controllerClassName($this->controllerName), 'controller');
     if (is_callable(array($this->controller, '__init'))) {
         $this->controller->__init();
     }
     $_REQUEST['controller'] = $this->controllerName;
     profile_point('H2Dispatcher.initController(' . $this->controllerName . ')');
     return $this;
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:20,代码来源:H2Dispatcher.php


示例11: render

 public function render()
 {
     $output = parent::render();
     $output .= "<div class='form-element-wrapper'>";
     if ($this->label && $this->attributes['id']) {
         $output .= "<label for='" . o($this->attributes['id']) . "'>" . o($this->label) . ": </label>";
     }
     $output .= "<select" . $this->getAttributeString() . ">";
     foreach ($this->options as $value => $option) {
         $option = o($option);
         $value = o($value);
         if ($value == $this->selected_option) {
             $output .= "<option selected value='{$value}'>{$option}</option>";
         } else {
             $output .= "<option value='{$value}'>{$option}</option>";
         }
     }
     $output .= "</select>";
     $output .= "</div>";
     return $output;
 }
开发者ID:FatBoyXPC,项目名称:worldcubeassociation.org,代码行数:21,代码来源:Select.class.php


示例12: group_delete

 function group_delete()
 {
     o(db)->remove('groups', $_REQUEST['id']);
     $this->viewName = 'groups';
 }
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:5,代码来源:devices.controller.php


示例13: listCompetitions

function listCompetitions () {
#----------------------------------------------------------------------
  global $chosenEventId, $chosenYears, $chosenRegionId, $chosenPatternHtml;
  global $chosenList, $chosenMap;
  global $chosenCompetitions;

  $chosenCompetitions = getCompetitions( $chosenList );

  tableBegin( 'results', 5 );
  tableCaption( false, spaced(array( eventName($chosenEventId), chosenRegionName(), $chosenYears, $chosenPatternHtml ? "\"$chosenPatternHtml\"" : '' )));

  if( $chosenList ){ 

    tableHeader( explode( '|', 'Year|Date|Name|Country, City|Venue' ),
                 array( 4 => 'class="f"' ));

    foreach( $chosenCompetitions as $competition ){
      extract( $competition );

      if( isset( $previousYear )  &&  $year != $previousYear )
        tableRowEmpty();
      $previousYear = $year;

      $isPast = wcaDate( 'Ymd' ) > (10000*$year + 100*$month + $day);

      tableRow( array(
        $year,
        competitionDate( $competition ),
        $isPast ? competitionLink( $id, $cellName ) : (( $showPreregForm || $showPreregList ) ? competitionLinkClassed( 'rg', $id, $cellName ) : competitionLinkClassed( 'fc', $id, $cellName )),
        "<b>$countryName</b>, $cityName",
        processLinks( $venue )
      ));
    }
  }

  tableEnd();


  if( $chosenMap ) {
    // create map markers
    $markers = array();
    foreach($chosenCompetitions as $comp) {
      $markers[$comp['id']] = array();
      $markers[$comp['id']]['latitude'] = $comp['latitude'];
      $markers[$comp['id']]['longitude'] = $comp['longitude'];
      $markers[$comp['id']]['info'] = "<a href='c.php?i=".$comp['id']."'>" . o($comp['cellName']) . "</a><br />"
        . date("M j, Y", mktime(0,0,0,$comp['month'],$comp['day'],$comp['year']))
        . " - " . o($comp['cityName']);
    }
    displayMap($markers);
  }
}
开发者ID:neodude,项目名称:worldcubeassociation.org,代码行数:52,代码来源:competitions.php


示例14: log_error

/**
 * Logs an error message to the error log. A newline character is appended to the message.
 * The given message is also echoed to the console.
 *
 * @param $message string the message to log.
 */
function log_error(string $message)
{
    global $board;
    o($message);
    file_put_contents($board . '.error', date("c: ") . $message . PHP_EOL, FILE_APPEND);
}
开发者ID:bstats,项目名称:b-stats,代码行数:12,代码来源:archiver.php


示例15: container

 function container()
 {
     return o('thinContainer');
 }
开发者ID:noikiy,项目名称:inovi,代码行数:4,代码来源:Helper.php


示例16: array

    <td style="text-align:right">
      <span class="faint">Direction</span>   
    </td>
    <td width="*">
      <?php 
$dirText = array(0 => 'None', 1 => 'Sender', 2 => 'Receiver');
print $dirText[$dev['DIRECTION']];
?>
</div>
    </td>  
  </tr>
  <?php 
$related = array();
$idnr = $ds['d_id'];
$idroot = CutSegment(':', $idnr);
foreach (o(db)->get('SELECT d_key,d_id,d_alias,d_type FROM devices WHERE d_id LIKE "' . $idroot . '%" ORDER BY d_id') as $dds) {
    $related[] = '<a href="' . actionUrl('params', 'devices', array('key' => $dds['d_key'])) . '" style="' . ($dds['d_key'] == $ds['d_key'] ? 'font-weight:bold;' : '') . '">' . htmlspecialchars(first($dds['d_alias'], $dds['d_type'])) . ' ' . $dds['d_id'] . '</a>';
    //array($ds['d_id'] => $ds['d_id'].' ('.first($ds['d_alias'], $ds['d_id']).')');
}
print '<tr><td valign="top" style="text-align:right"><span class="faint">Compound</span></td><td>' . implode(', ', $related) . '</td></tr></table>';
function showParam($val, $p, $k)
{
    global $actionEvents;
    switch ($p['TYPE']) {
        case 'BOOL':
            if ($p['WRITABLE'] && $p['ID'] != 'AES_ACTIVE') {
                return '<select name="' . $p['ID'] . '"><option' . ($val === true ? ' selected' : '') . '>Yes</option><option' . ($val != true ? ' selected' : '') . '>No</option></select>';
            } else {
                return $val === true ? 'Yes' : 'No';
            }
            break;
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:31,代码来源:devices.params.php


示例17: convertType

function convertType($value, $type)
{
    if ($value === NULL) {
        return $value;
    }
    $type = s($type)->parse_type();
    if ($type->isArray) {
        if (is_array($value)) {
            $newVal = array();
            foreach ($value as $key => $item) {
                if ($type->key !== NULL) {
                    $newVal[convertType($key, $type->key)] = convertType($item, $type->value);
                } else {
                    $newVal[] = convertType($item, $type->value);
                }
            }
            return $newVal;
        }
    } else {
        switch ($type->value) {
            case "void":
                return NULL;
            case "bool":
            case "boolean":
                return (bool) $value;
            case "FALSE":
            case "false":
                return FALSE;
            case "int":
            case "integer":
                return intval($value);
            case "float":
            case "double":
                return floatval($value);
            case "string":
                return strval($value);
            case "mixed":
                return $value;
            case "resource":
                return is_resource($value) ? $value : NULL;
            case "object":
                return is_object($value) ? $value : o($value)->cast();
            default:
                return o($value)->cast($type->value);
        }
    }
    return NULL;
}
开发者ID:naozone,项目名称:phx,代码行数:48,代码来源:ObjectClass.php


示例18: o

<p>Welcome to the exciting app template thinger!</p>
<p><?php 
o($test);
?>
</p>
<a href='<?php 
o($web_root);
?>
/example/test'>example</a><br />
<a href='<?php 
o($web_root);
?>
/app/this/is/a/test/omg/win'>test routes</a><br />
<a href='<?php 
o($web_root);
?>
/app/error'>generate a fatal error</a><br />
<a href='<?php 
o($web_root);
?>
/app/error2'>generate a fatal error with handlers</a><br />
开发者ID:allynbauer,项目名称:Condor,代码行数:21,代码来源:index.php


示例19: o

        <meta property="og:type" content="Science"/>
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/expdb.css">
        <link rel="stylesheet" href="css/share.css">
        <link rel="stylesheet" href="css/docs.css">
        <link rel="shortcut icon" href="img/favicon.ico">
        <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
	<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700' rel='stylesheet' type='text/css'>
    </head>
    <body>
            <div class="modal-body">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	    <?php 
if (false !== strpos($_SERVER['REQUEST_URI'], '/r/')) {
    o('run');
} elseif (false !== strpos($_SERVER['REQUEST_URI'], '/t/')) {
    o('task');
}
?>
	    </div>            <!-- /modal-body -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>            <!-- /modal-footer --> 
        <script src="js/libs/bootstrap.min.js"></script>
        <script src="js/plugins.js"></script>
        <script src="js/application.js"></script>
     </body>
</html>

开发者ID:jaksmid,项目名称:website,代码行数:29,代码来源:html_main.php


示例20: array

            break;
        case 'BLIND':
        case 'SWITCH':
            if (!isset($this->devices['HM:' . $h['ADDRESS']])) {
                // unknown device, make new dataset
                $dds = array('d_bus' => 'HM', 'd_type' => $h['TYPE'] == 'BLIND' ? 'Blinds' : 'Light', 'd_room' => 'unknown', 'd_name' => 'New ' . ($h['TYPE'] == 'BLIND' ? 'Blinds' : 'Switch') . ' ' . date('Y-m-d H:i:s'), 'd_id' => $h['ADDRESS']);
                $dds['d_key'] = o(db)->commit('devices', $dds);
                $this->devices['HM:' . $h['ADDRESS']] = $dds;
            }
            $this->devices['HM:' . $h['ADDRESS']]['info'] = $h;
            break;
        default:
            if (!isset($this->devices['HM:' . $h['ADDRESS']])) {
                // unknown device, make new dataset
                $dds = array('d_bus' => 'HM', 'd_type' => $h['TYPE'], 'd_room' => 'unknown', 'd_name' => 'New ' . $h['TYPE'] . ' ' . date('Y-m-d H:i:s'), 'd_id' => $h['ADDRESS']);
                $dds['d_key'] = o(db)->commit('devices', $dds);
                $this->devices['HM:' . $h['ADDRESS']] = $dds;
            }
            $this->devices['HM:' . $h['ADDRESS']]['info'] = $h;
            break;
    }
}
foreach ($this->devices as $d) {
    $di = array();
    foreach ($d as $k => $v) {
        $di[] = $k . '=' . $v;
    }
    ?>
<div><?php 
    echo implode(', ', $di);
    ?>
开发者ID:bangnaga,项目名称:HomeOverlord,代码行数:31,代码来源:devices.pair.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP oauth_check函数代码示例发布时间:2022-05-15
下一篇:
PHP nzshpcrt_form_field_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap