I'm following the tutorial at Phalcon's page (https://docs.phalconphp.com/en/3.4/tutorial-base) and I got stuck at creating the /view/signup/index.phtml.
When I access the /signup/index.phtml page it only shows me the HTML tags, that is, "Sign up using this form". None of the $this->tag
show. I copied the linkTo tag from the /views/index/index.phtml to the signup view but it didn't work as well, even though it's working perfectly in the index/index.phtml. Somehow no Tag is working at the /signup view.
Does anyone know why?
/app/controllers/SignupController.php
<?php
use Phalcon\Mvc\Controller;
class SignupController extends Controller
{
public function indexAction()
{
}
}
/app/views/signup/index.phtml
<h2>Sign up using this form</h2>
<?php echo $this->tag->form("signup/register"); ?>
<p>
<label for="name">Name</label>
<?php echo $this->tag->textField("name"); ?>
</p>
<p>
<label for="email">E-Mail</label>
<?php echo $this->tag->textField("email"); ?>
</p>
<p>
<?php echo $this->tag->submitButton("Register"); ?>
</p>
Views are not supposed to be accessed directly. Try to use Phalcon Developer Tools to set up your app skeleton or use the simple MVC example. Notice that you must have mod_rewrite
enabled (if you are working in Apache). Then continue following the tutorial (create the Loader
, DI
with view
, etc) and you will be surprised by the magic of Phalcon. Good luck!