當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。