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


PHP f::append方法代码示例

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


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

示例1: testAppend

 public function testAppend()
 {
     $this->assertTrue(f::append($this->tmpFile, ' is awesome'));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:4,代码来源:FTest.php

示例2: site

 //if page is accessed thorugh ajax
 if (r::ajax()) {
     //store sanitized $_POST variables
     $currentTestData = r::postData(array('test', 'user', 'data'));
     //get logged user (if any)
     if ($user = Auth::loggedUser()) {
         //get user's session page
         $userSession = site()->find(implode(DS, array(c::get('sessions.folder'), $user->session())));
         //istantiate testSession object
         $tSession = new testSession($userSession, $user->username());
         //get user's current session status
         $userSessionStatus = $user->status();
         //if ajaxed $currentTestData equals user's current session status
         if (str::lower($currentTestData['test']) == str::lower($userSessionStatus)) {
             //if it was possitble to update user's results file (by appending $currentTestData)
             if (f::append($tSession->getUserResultsFile(), PHP_EOL . a::json($currentTestData))) {
                 //set updated user's session status to next avalibale test
                 $updatedStatus = $tSession->getNextTest($currentTestData['test']);
                 //if there aren't tests available, set user's session statuts to completed session
                 if (!$updatedStatus) {
                     $updatedStatus = c::get('session.status.completed');
                 }
                 //update user's session status to next avalibale test
                 $user->update(array('status' => $updatedStatus));
                 //return to tests page
                 $url = $pages->find(c::get('tests.folder'))->url();
             }
         }
     }
 } else {
     //go to errorPage, since page wasn't accessed through ajax
开发者ID:alkaest2002,项目名称:risky2,代码行数:31,代码来源:cerebro.php


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