<form action='?r=users/login' method="POST"> <p> <label>Username <input name="username" /></label> </p> <p> <label>Password <input name="password" /></label> </p> <p> <input type="submit" /> </p> </form> <a href="<?php echo \helpers\Url::to(['users/register']); ?> ">Register</a>
public function redirect($url) { $url = Url::to($url); header('Location: ' . $url); }
if (\classes\F::$app->getUser()->getId()) { ?> <a href="<?php echo \helpers\Url::to(['users/logout']); ?> ">Logout</a> <a href="<?php echo \helpers\Url::to(['users/profile']); ?> ">Profile</a> <?php } else { ?> <a href="<?php echo \helpers\Url::to(['users/login']); ?> ">Login</a> <?php } ?> <?php// print_r($_SESSION) ?> </body> <?php echo $content; ?> <h1>Подвал</h1>
<h1>Список Объявлений</h1> <?php foreach ($items as $item) { ?> <p><?php echo $item['title']; ?> by <?php echo \models\User::findUserById($item['owner'])->username; ?> at <?php echo date('Y:m:d', \models\User::findUserById($item['owner'])->date_created); ?> </p> <?php } ?> <a href="<?php echo \helpers\Url::to(['items/create']); ?> ">Create new</a>
public static function actionColumn($model, $param) { return '<a href="' . Url::to(['view/' . $model->{$param}]) . '"><i class="glyphicon glyphicon-eye-open"></i></a> <a href="' . Url::to(['update/' . $model->{$param}]) . '"><i class="glyphicon glyphicon-pencil"></i></a> <a onclick="if (confirm(\'Are you sure want to delete this item?\') == false) return false" href="' . Url::to(['delete/' . $model->{$param}]) . '"><i class="glyphicon glyphicon-trash"></i></a>'; }