Project BLOG
Hi Guys,
I am following the video Project Blog, but on the earlier coding and testing - I got the error SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO). I tried to search for a fixed but I was not successfull.
My app/config/config.php was set.
'database' => array(
'adapter' => 'Mysql',
'host' => 'localhost',
'username' => 'blog',
'password' => 'WpEuhpjEsaFuV9eJ',
'dbname' => 'blog',
'charset' => 'utf8',
),
I run the phalcon model polls to create the model and it was successfull. Please see below.
# phalcon model polls
Phalcon DevTools (2.0.1)
Success: Model "polls" was successfully created.
My app/controller/PollController.php
public function indexAction() {
$this->view->polls = Polls::find();
}
My app/models/Polls.php (still no change)
// @var integer
public $id;
// @var string
public $question;
public function columnMap()
{
return array(
'id' => 'id',
'question' => 'question'
);
}
My app/views/poll/index.volt, is just a single liner.
<h1>Polls</h1>