PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, January 25, 2022

[FIXED] Can you call a controller function from a view in CakePHP?

 January 25, 2022     cakephp     No comments   

Issue

I want to call a controller function from a view. Is that possible in Cake PHP?


Solution

It is possible via the requestAction method, but it is not recommended due to a slight performance hit. Use it wisely.

As Xr noted in the comment, using requestAction often signifies design issues (MVC separation).



Answered By - dr Hannibal Lecter
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing