Now let's open
PostsController.php file located at
app/controllers in our editor. There is definitely a lot going on in this file. There are seven methods in our
PostsController class suffixed with actions. Each of these actions handles requests and creates responses in our application. Each corresponds to a URI in our application:
http://localhost/phalconBlog/[model]/[action]. When we browse to
http://www.localhost/phalconBlog/posts/, by default, the
indexAction function is called.
Let's take a look at each of these actions and modify them if we need to.
Let's take a look at the
createAction function, which saves our new blog posts for us.
First, we should learn a little about
Phalcon\Mvc\Dispatcher. The dispatcher ...