我在xampp/htdocs目录中有一个名为phalcon的简单项目,我将apache配置为指向该文件夹,以便我可以在浏览器中进入phalcon /.
当我尝试打开索引(默认)以外的索引控制器视图时,会发生此问题.
例如,我在索引控制器中有someAction,在views/index中我有some.phtml.
如果我去phalcon/index/some我没有把some.phtml的文本输出到页面.
这可能是因为它认为我不想打开IndexController-> indexAction并将一些作为参数传递.
将不胜感激为解决此问题提供任何帮助.
PS项目框架是从https://github.com/phalcon/skeleton-single复制的.
指数控制器:
<?php
class IndexController extends ControllerBase
{
public function indexAction($action = null)
{
}
public function someAction () {
exit('test');
}
}
Run Code Online (Sandbox Code Playgroud)
views/index/index.phtml:
<?php echo $this->getContent(); ?>
Run Code Online (Sandbox Code Playgroud)
视图/索引/ some.phtml:
Some Action
Run Code Online (Sandbox Code Playgroud)
意见/ index.phtml
<!DOCTYPE html>
<html>
<head>
<title>Phalcon PHP Framework</title>
</head>
<body>
<?php echo $this->getContent(); ?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我在使用 Phalcon php 检查 bcrypted 密码时遇到了一个小问题。我拥有的是:我检查密码的登录脚本
$username = $this->request->getPost('username', 'string');
$password = $this->request->getPost('password', 'string');
$conditions = "Username = :username:";
$parameters = array (
"username" => $username
);
$user = Users::findFirst(array($conditions, 'bind' => $parameters));
//check if user exists
if (count($user) > 0 && $user !== false) {
if ($this->security->checkHash($password, $user->Password)) //always fails {
//login
$this->session->set('username', $user->Password);
$this->response->redirect('index');
}
Run Code Online (Sandbox Code Playgroud)
在我的注册中,我有:
$name = $this->request->getPost('name', 'string');
$lastName = $this->request->getPost('lastName', 'string');
$username = $this->request->getPost('username', 'string');
$password = $this->request->getPost('password', 'string');
$email = $this->request->getPost('email', 'email');
$user = …Run Code Online (Sandbox Code Playgroud)