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


PHP CUser::printAndPostUpdate方法代码示例

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


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

示例1: CDatabase

/**
 * This is a Hera pagecontroller.
 *
 */
// Include the essential config-file which also creates the $anax variable with its defaults.
include __DIR__ . '/config.php';
$hera['stylesheets'][] = 'css/forms.css';
$db = new CDatabase($hera['database']);
$user = new CUser($db);
//metod som returerar användar object $profile
//flytta allt till CUser
// $html = $user->printProfile();
if ($user->IsAuthenticated()) {
    if (isset($_GET['id'])) {
        $user->getEntryByID($_GET['id']);
        $html = $user->printAndPostUpdate();
    } else {
        $html = $user->printProfile($user->GetAcronym());
    }
} else {
    $html = "För att visa din profil behöver du <a href='login.php'>logga in</a>.";
}
// Do it and store it all in variables in the Hera container.
$hera['title'] = "Min sida";
$hera['main'] = <<<EOD
<h1>{$hera['title']}</h1>
{$html}
EOD;
//Finally, leave it all to the rendering phase of Hera.
include HERA_THEME_PATH;
开发者ID:EmilSjunnesson,项目名称:rental,代码行数:30,代码来源:me.php

示例2: CDatabase

$hera['stylesheets'][] = 'css/forms.css';
$hera['stylesheets'][] = 'css/tables.css';
$hera['title'] = "Hantera användare";
// Database
$db = new CDatabase($hera['database']);
//user class
$user = new CUser($db);
if ($user->IsAuthenticated()) {
    if (isset($_GET['new'])) {
        $hera['main'] = $user->printAndPostAdd();
    } elseif (isset($_GET['delete'])) {
        $user->getEntryByID($_GET['delete']);
        $user->deleteEntry();
    } elseif (isset($_GET['id'])) {
        $user->getEntryByID($_GET['id']);
        $hera['main'] = $user->printAndPostUpdate();
    } else {
        $list = $user->getUserList();
        $new = $user->IsAdmin() ? "<p><a class='as-button' href='?new'>Lägg till en ny användare</a></p>" : "<p>För att skapa, radera och ändra användare behöver man vara inloggad som admin.</p>";
        $hera['main'] = <<<EOD
<h1>{$hera['title']}</h1>
{$new}
<p>Här är en lista på allt innehåll i användar-databasen</p>
{$list}
EOD;
    }
} else {
    $hera['main'] = "<h1>{$hera['title']}</h1>För att visa innehållet behöver du <a href='login.php'>logga in</a>.";
}
//Finally, leave it all to the rendering phase of Hera.
include HERA_THEME_PATH;
开发者ID:EmilSjunnesson,项目名称:rental,代码行数:31,代码来源:edit_users.php


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