Use model inside helper class cakephp
Posted on February 23, 2010

Hello All,

Finally after researching for hours we got the solution to call a model inside a helper class. we hope this helps you.

In a method of your helper class just use : $this->ModelName=& ClassRegistry::init(’ModelName’);

And now $this->ModelName has all the property of the model.

Do let us know if you are unable to use the same.

Happy Algo-blogging.


« Set JAVA_HOME environment variable on Red Hat Linux
Meta Tag: How to set page title, meta keyword/description in Cakephp 1.2 & Cakephp 1.3. »


3 Responses

  • Mario Says:
    February 9th, 2011 at 5:04 pm

    Thanx!

  • M Gaya Says:
    February 14th, 2011 at 10:20 am

    Thank you for this update! ;) It works for me as well..

  • Michal Says:
    February 18th, 2011 at 4:06 pm

    Yes it works!

Leave a Reply