Web 超链接按钮不工作
这是我的主页。没什么,只有3个重定向到不同页面的标签。 代码: { }Web 超链接按钮不工作,web,hyperlink,routing,Web,Hyperlink,Routing,这是我的主页。没什么,只有3个重定向到不同页面的标签。 代码: { } 我知道你在想什么。将a/放入h1标记中。我已经试过了,可惜没用。我注意到,如果我将@Route'/dashboard'更改为@Route'/dashboard',它将加载我的仪表板页面。结果表明,我没有启用apache2重写模块。 解决方案如下: <div> <h1> Welcome to my YeePHP project</h1> <h1> Click <a href
我知道你在想什么。将a/放入h1标记中。我已经试过了,可惜没用。我注意到,如果我将@Route'/dashboard'更改为@Route'/dashboard',它将加载我的仪表板页面。结果表明,我没有启用apache2重写模块。 解决方案如下:
<div>
<h1> Welcome to my YeePHP project</h1>
<h1> Click <a href=" register "> here </a> to register</h1>
<h1> Click <a href=" login "> here </a> to login</h1>
<h1> Click <a href=" dashboard "> here </a> to enter the dashboard</h1>
class DashboardController extends \Yee\Managers\Controller\Controller
/**
* @Route('/dashboard')
* @Name('dashboard.index')
*/
public function index()
{
$app = $this->getYee();
$app->render('dashboard/dashboard.twig', $data = array(
));
}
/**
* @Route('/dashboard')
* @Name('dashboard.post')
* @Method('POST')
*/
public function post()
{
$app = $this->getYee();
$name = $app->request->post('name');
$comment = $app->request->post('comment');
$AddCommentModel = new AddCommentModel($name, $comment);
if($AddCommentModel->comment() == true)
{
$AddCommentModel->insertCommentsInDb();
$app->render('dashboard/dashboard.twig', $data = array());
}
else
{
$data = array(
"error"
);
}
}