本文整理汇总了PHP中core\View::make方法的典型用法代码示例。如果您正苦于以下问题:PHP View::make方法的具体用法?PHP View::make怎么用?PHP View::make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\View
的用法示例。
在下文中一共展示了View::make方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($id = null)
{
if (!$id) {
\Core\Route::redirectTo('/absent');
} else {
$id = str_replace("id", "", $id);
$user = \Models\User::findUserById($id);
if (isset($user['id'])) {
$user = \Models\User::getUserPersonalById($user['id']);
$task = \Models\Load::issetUploadFile('task');
if ($task != false) {
\Models\Load::uploadTask($_FILES[$task]);
}
$data = \Models\User::findUserById($id);
$tasks = \Models\Task::showTask();
echo View::make('header', ['title' => $user['l_name'] . " " . $user['f_name']]);
if ($user['member'] == 'Mather') {
echo View::make('user.leftside', ['id' => $id, 'user' => $user]);
}
if ($user['member'] == 'Father') {
echo View::make('user.profileF', ['data' => $data, 'tasks' => $tasks]);
} else {
echo View::make('user.profile', ['data' => $data, 'tasks' => $tasks]);
}
echo View::make('footer');
} else {
\Core\Route::redirectTo('/absent');
}
}
}
示例2: index
public function index()
{
if (!isset($_GET['code'])) {
header("Location: ../sign-in/index");
exit;
}
$testActivation = \Models\User::getUsernameByActivationCode($_GET['code']);
if (!isset($testActivation['username'])) {
echo \Core\View::make('header', ['title' => 'Activation unsuccessful']);
echo \Core\View::make('activation.bad');
echo \Core\View::make('footer');
} else {
$date = date('Y-m-d H:i:s');
$user = \Models\User::setUserActivatedAt($date, $_GET['code']);
if (isset($user['id'])) {
$subject = 'Welcome';
$body = "Congratulations. Your account is activated.";
$result = Mailer::send($user['email'], $subject, $body);
if ($result == 'Message has been sent') {
echo \Core\View::make('header');
echo \Core\View::make('activation.good', ['title' => 'Activation successful']);
echo \Core\View::make('footer');
}
}
}
}
示例3: subpage
/**
* Render the subpage page.
*
* @param \Psr\Http\Message\ServerRequestInterface $request
* @param \Psr\Http\Message\ResponseInterface $response
* @return \Psr\Http\Message\ResponseInterface
*/
public function subpage(Request $request, Response $response)
{
$translator = $this->get('translator');
$data = ['title' => $translator->get('welcome.subpage_text'), 'welcomeMessage' => $translator->get('welcome.subpage_message')];
$view = View::make('layouts::default', $data);
$view->nest('body', 'welcome.subpage', $data);
return $response->write($view);
}
示例4: personal
public function personal()
{
if (\Models\Auth::isAuth()) {
$avatar = \Models\Images::issetUploadImages('avatar');
if ($avatar != false) {
\Models\Images::uploadAvatar($_FILES[$avatar]);
}
$personal = [];
$personal = \Models\User::getUserPersonalById($_SESSION['auth']['id']);
$plug = \Models\Images::isPlug($_SESSION['auth']['id'] . '.jpg');
echo View::make('header', ['title' => 'Personal']);
echo View::make('user.leftside', ['id' => $_SESSION['auth']['id'], 'plug' => $plug]);
echo View::make('user.personal', ['personal' => $personal]);
echo View::make('footer');
} else {
\Core\Route::redirectTo('/absent');
}
}
示例5: index
public function index()
{
echo View::make('header', ['title' => 'Authentication']);
echo View::make('sign_in.sign-in', ['title' => 'Sign in']);
echo View::make('footer');
}
示例6: index
public function index()
{
echo View::make('header', ['title' => 'Add task']);
echo View::make('task.add-task');
echo View::make('footer');
}
示例7: index
public function index()
{
echo \Core\View::make('header', ['title' => 'Registration']);
echo \Core\View::make('sign_up.sign-up', ['title' => 'Registration']);
echo \Core\View::make('footer');
}
示例8: nest
/**
* Add a view instance to the view data.
*
* <code>
* // Add a View instance to a View's data
* $view = View::make('foo')->nest('footer', 'Partials/Footer');
*
* // Equivalent functionality using the "with" method
* $view = View::make('foo')->with('footer', View::make('Partials/Footer'));
* </code>
*
* @param string $key
* @param string $view
* @param array $data
* @param string|null $module
* @return View
*/
public function nest($key, $view, array $data = array(), $module = null)
{
return $this->with($key, View::make($view, $data, $module));
}
示例9: password
public function password()
{
echo \Core\View::make('header', ['title' => 'Recovery password']);
echo \Core\View::make('forgot.email', ['title' => 'Recovery password']);
echo \Core\View::make('footer');
}