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


PHP Gdn_Format::ArrayAsObject方法代码示例

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


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

示例1: CamelizeResult

 function CamelizeResult($Data, $bRemoveUnderscoreKeys = True)
 {
     $Data = Gdn_Format::ObjectAsArray($Data);
     $Keys = array_keys($Data);
     $CamelizedKeys = array_map('Camelize', $Keys);
     $Keys = array_combine($Keys, $CamelizedKeys);
     foreach ($Keys as $Key => $CamelizedKey) {
         $Data[$CamelizedKey] = $Data[$Key];
         if ($bRemoveUnderscoreKeys) {
             unset($Data[$Key]);
         }
     }
     $Data = Gdn_Format::ArrayAsObject($Data);
     return $Data;
 }
开发者ID:ru4,项目名称:arabbnota,代码行数:15,代码来源:functions.array-object.php

示例2: GetAllSettings

 public function GetAllSettings()
 {
     self::$All = array('SearchOptions' => Gdn_Format::ArrayAsObject(self::GetSearchOptions()), 'Wizard' => Gdn_Format::ArrayAsObject(self::GetWizardSettings()), 'Install' => Gdn_Format::ArrayAsObject(self::GetInstall()), 'Status' => Gdn_Format::ArrayAsObject(self::GetStatus()), 'Admin' => Gdn_Format::ArrayAsObject(self::GetAdminSettings()));
     return self::$All;
 }
开发者ID:Nordic-T,项目名称:vanilla-plugins,代码行数:5,代码来源:class.sphinxsearchsettings.php

示例3: RunSearch

 private function RunSearch($Sender = FALSE)
 {
     $FinalResults = array();
     if (sizeof($this->Queries) == 0) {
         return $FinalResults;
     } else {
         if (true) {
             //if($this->Settings['Status']->SearchdRunning)
             //print_r($this->Queries); die;
             // print_r($this->SphinxClient->_filters); die;
             $Results = $this->SphinxClient->RunQueries();
             //perform all of the queries
             //print_r($Results); die;
             /**
              * This will publicly announce any errors or warnings to the main search page. If this is unwarranted, simply
              * comment the following few lines. However this if usually the first place to look for any errors in the install
              */
             if ($Results === false) {
                 echo "Query failed: " . $this->SphinxClient->GetLastError() . ".\n";
             } else {
                 if ($this->SphinxClient->GetLastWarning()) {
                     echo "WARNING: " . $this->SphinxClient->GetLastWarning() . ".\n";
                 }
             }
             if ($Results) {
                 foreach ($this->Queries as $Query) {
                     $ResultDocs = array();
                     $Index = $Query['Index'];
                     $Name = $Query['Name'];
                     $Result = $Results[$Index];
                     //get the individual query result from the results tree
                     if ($Result['error'] == FALSE && $Result['total_found'] != 0 && isset($Result['matches'])) {
                         //no errors
                         foreach ($Result['matches'] as $Id => $Info) {
                             //preserve the returned Doc ID
                             if (isset($Info['attrs'])) {
                                 $ResultDocs[$Id] = Gdn_Format::ArrayAsObject($Info['attrs']);
                             }
                             //get the result documents
                         }
                         $Words = '';
                         if (isset($Result['words'])) {
                             foreach ($Result['words'] as $Word => $Info) {
                                 $Words .= $Word . ' ';
                                 //get the submitted input query
                             }
                             $Results[$Index]['query'] = $Words;
                             //add the query back into the resuls array
                         }
                         $Results[$Index]['matches'] = $ResultDocs;
                         //replace highlighted docs back into the main results array
                     }
                     $FinalResults[$Name] = $Results[$Index];
                 }
             }
         }
     }
     //PRINT_R($FinalResults); die;
     return $FinalResults;
 }
开发者ID:Nordic-T,项目名称:vanilla-plugins,代码行数:60,代码来源:class.sphinxsearchlite.plugin.php

示例4: foreach

<ul class="DataList SearchResults">
<?php 
if (is_array($this->SearchResults) && count($this->SearchResults) > 0) {
    foreach ($this->SearchResults as $Key => $Row) {
        $Row = Gdn_Format::ArrayAsObject($Row);
        ?>
	<li class="Item">
		<div class="ItemContent">
			<?php 
        echo Anchor(Gdn_Format::Text($Row->Title), $Row->Url, 'Title');
        ?>
			<div class="Excerpt"><?php 
        echo Anchor(SliceString($Row->Summary, 250), $Row->Url);
        ?>
</div>
			<div class="Meta">
				<span><?php 
        printf(T('Comment by %s'), UserAnchor($Row));
        ?>
</span>
				<span><?php 
        echo Gdn_Format::Date($Row->DateInserted);
        ?>
</span>
				<span><?php 
        echo Anchor(T('permalink'), $Row->Url);
        ?>
</span>
			</div>
		</div>
	</li>
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:31,代码来源:results.php


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