Integrate js helper from cakephp 1.3.7 to cakephp 1.2.5
I am working on a project based on cakePHP 1.2.5. Now I need to use new JS helper defined in cakePHP 1.3.7.
I want to use 开发者_运维技巧some methods of JS helper like $this->Js->buffer("some code"), $this->Js->writeBuffer()...
Is it possible to include this JS helper only to cakePHP 1.2.5? and How?
Thanks
I don't think you can because the basic way of calling the class has changed. In 1.2.5 the helper classes were not attached to the $this object in your view.
I think the better question would be to see if you can upgrade from 1.2 to 1.3. What are the requirements keeping you from upgrading, if any.
I would update your project to the current version of cakephp. A lot of bugs were fixed and other things were optimized.
But you can use the normal php or javascript functions...or build your own methods to solve your problem...
You could try to copy the JsHelper
and its dependencies (HtmlHelper
, FormHelper
, and the engine helper for the Javascript framework you use) to the helpers
folder of your application, though I don't know whether this will work...
However, even if this should work it is a hack, and I would consider to upgrade to CakePHP 1.3.x or to write your own helper providing the desired functionality.
精彩评论