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


I am currently a website developer using Laravel as my main framework for work. I would like to use the Falcons for any project, which is beneficial to me, but there are issues related to some things about my head.

I would like to know how the vendor \ package is used to pass a controller to see again?

Currently, the document shows that the 'use' case is being added to the scene which I do not want because I want to clear my thoughts and believe that it should be done in the controller .

I have tried at present ...

  & lt; Use php Phalcon \ Tag; Class Index Controller ControllerBase {Public Function Index Action () {}}  

and then added to my view ...

  & lt; H2 & gt; The form below & lt; / H2 & gt; & Lt ;? Php echo tag :: form ("signup / register"); ? & Gt; & Lt; P & gt; & Lt; Label = "name" & gt; Name & lt; / Label & gt; & Lt ;? Php echo tag :: textfield ("name")? & Gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label = "username" & gt; Username & lt; / Label & gt; & Lt ;? Php echo tag :: textfield ("user name")? & Gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label = "password" & gt; Password & lt; / Label & gt; & Lt ;? Php echo tag :: passwordField ("password")? & Gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label = "email" & gt; Email & lt; / Labels & gt; & Lt ;? Php echo tag :: textfield ("email")? & Gt; & Lt; / P & gt; & Lt; P & gt; & Lt ;? Php echo tag :: submitButton ("register")? & Gt; & Lt; / P & gt;  

But then it says that the class tag can not be found.

No, no help will be appreciated on this.

Besides, I do not think PHP uses the way you want to work it.

You are using the Usage statement in a file and you expect to work in another.

According to Docs, the easiest way to do this is:

  & lt ;? Php echo $ this- & gt; Tag- & gt; Textfield ("email")? & Gt;  

Once this is a tag service and access to viewing it (so long as providing a view).


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -