php - Phalcon "use Vendor\Package" pass to view -



php - Phalcon "use Vendor\Package" pass to view -

i'm website developer using laravel main framework work. using phalcon projects may benefit it, having problem getting head around thing.

i know know how add together utilize vendor\package controller gets passed on view?

currently, documentation shows 'use' case beingness added view don't want have views tidy , believe should done in controller.

i've tried...

<?php utilize phalcon\tag; class indexcontroller extends controllerbase { public function indexaction() { } }

and in view added...

<h2>sign using form below</h2> <?php echo tag::form("signup/register"); ?> <p> <label for="name">name</label> <?php echo tag::textfield("name") ?> </p> <p> <label for="username">username</label> <?php echo tag::textfield("username") ?> </p> <p> <label for="password">password</label> <?php echo tag::passwordfield("password") ?> </p> <p> <label for="email">email</label> <?php echo tag::textfield("email") ?> </p> <p> <?php echo tag::submitbutton("register") ?> </p>

but says class tag can not found. help on appreciated.

thanks in advance.

why not using in docs?

besides don't think php work way want.

you using use statement in 1 file , expect work in other.

according docs easiest way to:

<?php echo $this->tag->textfield("email") ?>

since tag service , have access on view instance (so while rendering view).

php phalcon

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -