當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserController::show方法代碼示例

本文整理匯總了PHP中UserController::show方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserController::show方法的具體用法?PHP UserController::show怎麽用?PHP UserController::show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserController的用法示例。


在下文中一共展示了UserController::show方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public static function run()
 {
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $webuser = new WebUser($_POST);
         if ($webuser->getErrorCount() == 0) {
             if (!empty(WebUserDB::getUsersBy('hockName', $webuser->getHockName()))) {
                 $webuser->setError('hockName', 'HOCKUSER_NAMECLAIMED');
                 SignupView::show($webuser);
             } else {
                 //create a webuser in db
                 $id = WebUserDB::addUser($webuser);
                 if ($id != 0) {
                     $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : "";
                     //find the hockuser related to this dude
                     //$hockusers = HockUserDB::getUsersBy('name', $webuser->getHockName());
                     header("Location: /" . $base . "/user/show/" . $webuser->getHockName());
                     UserController::show();
                     //ProfileView::show($webuser, $hockusers[0]);//HomeView::show();
                 } else {
                     $webuser->setError('userName', 'DBERROR_ADDWEBUSER');
                     SignupView::show($webuser);
                 }
             }
         } else {
             SignupView::show($webuser);
         }
     } else {
         // Initial link
         SignupView::show(null);
     }
 }
開發者ID:Trivette,項目名稱:cs4413,代碼行數:31,代碼來源:SignupController.class.php

示例2: run

 public static function run()
 {
     // Perform actions related to a user
     $action = array_key_exists('action', $_SESSION) ? $_SESSION['action'] : "";
     $arguments = $_SESSION['arguments'];
     switch ($action) {
         case "leaderboard":
             $_SESSION['users'] = HockUserDB::getAllUsers();
             $_SESSION['headertitle'] = "Hock League Leaderboard";
             UserView::showall();
             break;
         default:
             //Find the specified user
             $webuser = null;
             $hockusers = HockUserDB::getUsersBy('name', $action);
             if (empty($hockusers)) {
                 $hockusers = HockUserDB::getUsersBy('alias', $action);
                 if (empty($hockusers)) {
                     $hockuser = null;
                 } else {
                     $hockuser = $hockusers[0];
                 }
             } else {
                 $hockuser = $hockusers[0];
             }
             if (!is_null($hockuser)) {
                 //Find webuser associated with hockuser?
                 $webusers = WebUserDB::getUsersBy('hockName', $hockuser->getUserName());
                 if (!empty($webusers)) {
                     $webuser = $webusers[0];
                 }
             }
             $_SESSION['hockuser'] = $hockuser;
             $_SESSION['webuser'] = $webuser;
             UserController::show();
     }
 }
開發者ID:Trivette,項目名稱:cs4413,代碼行數:37,代碼來源:UserController.class.php

示例3: function

    SessionController::create();
});
$routes->get('/logout', function () {
    SessionController::destroy();
});
$routes->get('/signup', function () {
    UserController::create();
});
$routes->post('/signup', function () {
    UserController::store();
});
$routes->get('/user', function () {
    UserController::index();
});
$routes->get('/user/:id', function ($id) {
    UserController::show($id);
});
$routes->post('/user/:id', function ($id) {
    UserController::update($id);
});
$routes->get('/user/:id/edit', function ($id) {
    UserController::edit($id);
});
$routes->get('/user/:id/destroy', function ($id) {
    UserController::destroy($id);
});
$routes->get('/group', function () {
    GroupController::index();
});
$routes->post('/group', function () {
    GroupController::store();
開發者ID:tuureilmarinen,項目名稱:tsoha,代碼行數:31,代碼來源:routes.php

示例4: function

});
$routes->post('/register/', function () {
    UserController::handle_register();
});
$routes->post('/user/:user_id/delete', function ($item_id) {
    UserController::destroy($item_id);
});
$routes->get('/user/:user_id/edit', function ($user_id) {
    UserController::edit($user_id);
});
$routes->post('/user/:user_id/edit', function ($user_id) {
    UserController::update($user_id);
});
// Vaatteen esittelysivu
$routes->get('/user/:item_id', function ($user_id) {
    UserController::show($user_id);
});
// Vaatteet
// Vaatteiden indeksisivu
$routes->get('/items/', function () {
    ItemController::index();
});
// Vaatteen lisäyssivu
$routes->get('/items/new', function () {
    ItemController::create();
});
// Vaatteen esittelysivu
$routes->get('/items/:item_id', function ($item_id) {
    ItemController::show($item_id);
});
// Vaatteen muokkaussivu - esittäminen
開發者ID:juhapekkamoilanen,項目名稱:Tsoha-Bootstrap,代碼行數:31,代碼來源:routes.php

示例5: execute

class LogToFile implements Logger
{
    public function execute($message)
    {
        var_dump('log the message to a file:' . $message);
    }
}
class LogToDatabase implements Logger
{
    public function execute($message)
    {
        var_dump('log the message to a DataBase:' . $message);
    }
}
//...
class UserController
{
    protected $logger;
    public function __construct(Logger $logger)
    {
        $this->logger = $logger;
    }
    public function show()
    {
        $user = 'John Doe';
        $this->logger->execute($user);
    }
}
$controller = new UserController(new LogToDatabase());
$controller->show();
開發者ID:rogermelich,項目名稱:Laracast_Exercicis,代碼行數:30,代碼來源:Logger.php


注:本文中的UserController::show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。