Method list:


Update: New methods have arrived!

New methods:

Comments

  1. alejandro(Bolivia) wrote:

    ¡que bueno que se cuente con Jquery es este frame work! Se que a muchos les agradara. saludos

  2. Tobias wrote:

    Hi,

    Just by fast checking the source code it seams like this class requires PHP 5 and won't be working as expected with PHP 4 (due to the constructors), isn't that a bit weird since CakePHP only have stable versions for PHP 4+ ?

    Regards
    Tobias

  3. Alexey wrote:

    I've checked your helper and found that $this->RequestHandler->isAjax() in controller returns false, if use default contentType. I don't see any reason why this happens...

  4. Alexey wrote:

    Oops, sorry. It was Security component that was the cause. Don't look at my previous post.

  5. kvas wrote:

    Tobias: this constructor is used in cakePHP core. So I think that it'll work with PHP 4+

  6. timothy wrote:

    Thank you very much for your efforts. I appreciate it. Will test it soon. Again , thx. Greetings from Germany

  7. MaxN wrote:

    Pretty nice! Just what I wanted.
    maybe this helper becomes standard in a year.

  8. Raza wrote:

    I have seen this helper methods and documentation, but still didnt use........ I am sure from its docs that will be great helper for Ajax lovers in cakephp

  9. rasta wrote:

    thx, really nice work

  10. David wrote:

    Nice Work.Pls i am having an issue. when using the link, its generating Event.observe which is a prototype event. Pls how do handle this issue. I am using the latest stable version of cakephp.Thanks

  11. David U wrote:

    Pls i sincerely apologize for the multiple submissions, my internet speed was very slow and i kept refreshing not knowing that it was submitting to your site. Pls i accept my apologies....still expecting your reply. Thanks

  12. rahat wrote:

    nice work

  13. kvas wrote:

    David U:
    You should place javascript.php in your helpers directory.

  14. David U wrote:

    kvas thanks a million. It worked! Great Job...Do have a great day

  15. Abdul wrote:

    Hi I am trying to upload file using ajax form but it is not working.

  16. kvas wrote:

    Abdul: You need other helper for ajax file uploading.
    This helper, like base Ajax Helper, is not including this feature.

  17. Benny L.E.P wrote:

    Thank you for your great effort and i will test it :)

  18. Jimmer wrote:

    Works great, many thanks ;]

  19. Manuel Andres Diaz wrote:

    Muchas Gracias por este helper, es maravilloso, hace rato estaba buscando algo asi.

    Eternamente agradecido

  20. Léo Haddad wrote:

    Very nice helper!
    Thanks!

  21. Hristo wrote:

    Finaly! That is , what i need! Thanks!

  22. regz wrote:

    Great helper...

  23. khan wrote:

    Hello,
    I am having a problem. i want to update/add row to table but my response contains <html tags. i only want <td elements i have tried setting layout=NULL but not working.
    any help

  24. khan wrote:

    well i have checked the response. it contains what i am looking for but while updating it is removing td elements :/ I am updating <tr> element on form submit

  25. kvas wrote:

    khan:

    You can try:
    $this->layout = 'ajax';

    ajax layout should placed in app/view/layouts/ (it is placed here at default).

  26. Geidivan J. wrote:

    Hi kvas,

    I'm using your helper (it's excelent).

    So, i am with problems to use it in Google Chrome. An error message appears on every ajax request:

    XML cannot be read [CORE/cake/libs/xml.php, line 883]

    But the ajax works. I read that the problem is solved setting the request header type (request.setRequestHeader( ‘Content-type’, ‘text/plain’);”;).

    How can I fix it in your helper?

  27. kvas wrote:

    Hi Geidivan J.!
    You can try additional option named 'contentType'...

    Example:

    <?php echo $ajax->link(
    'View Post',
    array( 'controller' => 'ajax', 'action' => 'view', 1 ),
    array( 'update' => 'post', 'contentType' => 'text/plain')
    );
    ?>

    I'll glad if you write if this helped. BTW. I'm not getting this error in my chrome :/

  28. Geidivan J. wrote:

    Thanks kvas, it worked perfectly (your answers are fast).

  29. Eric wrote:

    Hi there,

    What is the proper call to check if ajax is being used in my controller? I tried isAjax() as well as $this->requestHanlder->isAjax() and neither seem to work.

    Thanks!

  30. kvas wrote:

    Hi Eric!

    I'm using
    $this->params['isAjax']

    and it's working for me :)

  31. Eric wrote:

    That worked! Thanks!

  32. Miguel wrote:

    Gracias por el aporte

  33. Giuliano wrote:

    Hi. I have a button when the user click on the button, the ajax call a method. This method, return a array and each elements must be set in differents text fields. How can i do it?
    thanks.

  34. Risto wrote:

    Thanks a lot, kvas!

    I did not believe my eyes when I saw this actually working. I have had too much pain getting Prototype, Script.aculo.us & jQuery working nicely together, but this is a real solution. And a fast one too (much faster auto complete!). All my auto complete fields, ajax forms and such worked straight away!

  35. vinay wrote:

    i m new to cakephp ......... i have problem with image uploading ... i used ajax helper, in comments i read about ajax file uploading helper , can you please give me link for ajax file uploading helper or little bit description about ajax file uploading helper...thanks .

  36. kvas wrote:

    vinay, you can try with http://www.davidgolding.net/cakephp/ajax-file-uploading-with-cake-and-jquery.html

  37. vinay wrote:

    hi...

    Thanks a Lot ....

    i update my jquery with jquery 1.2.2 as instruction given in link , it works but i got error in js file
    f.offset is undefined
    jquery-ui-1.8rc3.custom.min.js


  38. kvas wrote:

    vinay , you should use more actual version than 1.2.2 (like 1.4.2)...

    I didn't ever get this error, so I can't help you at this moment...

  39. Geidivan wrote:

    Hi,

    How can I change the charset of the ajax requests? I'm using de remoteTimer with 'contentType' => 'text/plain' but I would like to change the charset.

    thanks.

  40. Louie Miranda wrote:

    Hi Kvas, I was wondering if you can still use Prototype and script.aculo.us even after adding the jquery helper?

    Thanks!

  41. kvas wrote:

    Geidivan, I think that jQuery doesn't provide this feature. You can build callback method that will converse from one charset to the other.

    Louie Miranda, no at this moment jQuery is not installed in compatibile mode...

  42. Eric wrote:

    Hi Kvas,

    I've been using your helper, fantastic stuff. Thank you!

    Quick question, is there any way at all to support file upload? I notice you only allow "post" or "get" as form types currently.

    Thanks! And any way I can help out with this project, let me know.

    Eric

  43. kvas wrote:

    Hi Eric,

    I didn't try try to upload files by this helper yet, so at this moment I think it's not posibble :)

    Maybe in future I'll add support for those features...

  44. Eric Anderson wrote:

    Kvas,


    I'm interested in helping you develop this functionality. Let me know when you are available to discuss. I've sent you my email via your contact form.

    Thanks!

    Eric

  45. JaRo wrote:

    Dobra robota, dzięki wielkie!

  46. smiler wrote:

    Any chance in a datepicker, kvas? :)

  47. cybercoder wrote:

    Hi Kvas & Thanx for this useful helper
    but there is a problem with that when i use IE, <DIV> s don't show!!!!
    Just tables and text shown!

    "I cleared cache & ..."

  48. kvas wrote:

    Hi

    smiler: I'm working at this feature ATM.

    cybercoder: few days ago I changed some css styles, maybe that was the problem...

  49. gabrielr wrote:

    Supporting smiler comment,

    A datePicker will be a nice methodo to add,

    I'll be wating !!!!

    And again, nice work

  50. Dipankar wrote:

    This is the most amazing work i must say.
    Now for a while i am working with cakephp and i am mixing prototype and jquery for my sites and i have to write noconflict here and there.

    but i found this and really speaking this thing saved me from worrying to much about the conflict and all .
    Thank You

  51. kvas wrote:

    As I promised: new helper methods have arrived.

    I know that most of them are User Interface method, but I don't want to create another helper to provide new functionalities.

    Good news for gabrielr and smiler :) Datepicker inside!

    If you find any bug or language mistake give me feedback here! Many thanks for help in testing new features.

  52. gabrielr wrote:

    Yeah !! new methods have arrived !!!

    Nice work, excellent Helper !!!



  53. David wrote:

    Thanks for your helper, it was indeed of great help :)

  54. smile wrote:

    Hi kvas,

    Do any of your functions assist in the dynamically auto populating of drop down boxes?

    For example.. I select an option from dropdown box 1, and the options in dropdown box 2 and 3 are populated accordingly?

    cheers,

  55. kvas wrote:

    Hi smile,

    No, but method from this helper you can't easly create drop down menu.
    But you can try one of those examples:
    http://www.1stwebdesigner.com/resources/38-jquery-and-css-drop-down-multi-level-menu-solutions/

  56. smiler wrote:

    Thanks!

  57. smiler wrote:

    kvas,

    regarding dropdown textfields... the link help you have that calls content into a div.. I wasn to use that,but from a dropdown..

    so dropdown form field has a few options and if I select one of those options, it calls your link function passing the option value... is that possible?

    many thanks

  58. kvas wrote:

    Hi smiler,

    I don't know what you actually want to do so I can't help you. But if you're trying to make complex JavaScripts, I think you should use plain jquery (without helper).

  59. Adam wrote:

    Hi Kvas,
    Your helper is wonderful, can you help me to log Auth with Ajax ? do you have it already ?

  60. cakephpcebu wrote:

    Hi,

    How do I put the method codes to be inside a document ready function..?


    <?=$ajax->tabs('tabs')?>


    it's just producing the code

    <script type="text/javascript">
    //<![CDATA[
    var tabs = $('#tabs').tabs({});
    //]]>
    </script>

    it's resulting to javascript error $("#tabs").tabs is not a function

    Am I missing something here?

    thanks

  61. kvas wrote:

    Hi cakephpcebu,

    I think that there is no problem with 'ready' but with your javascript libraries. Check that you include jquery and jqueryui (with tabs).

    @Adam: what kind of problem do you have?

  62. Adam wrote:

    hi,
    I just want to connect (login/pass) with ajax in cakephp.

  63. kvas wrote:

    Hi Adam,
    Try to wrote some code by your self and ask me if you have any problems...

  64. Jer wrote:

    Hello Kvas,
    It is possible to use the paginate method include in Cakephp for making ajax link with your helper ?

  65. kvas wrote:

    Hi Jer,
    I've never tried to do this functionality. You must check it on you own hand.

  66. Eric wrote:

    Hi Kvas,

    I was wondering if there is a "replace" option for position with Ajax->link? I want the returned content to replace the anchor element rather than be appended, etc.

    Is this functionality available with your plug-in? Is there any other way to accomplish this?

    Thanks!

    Eric

  67. Eric wrote:

    Hi Kvas,

    Another quick question. Does this helper work with 'JQuery Live'? When I load content using an AJAX link, and in that content there is another ajax link that loads content, it seems to not work when I click it.

    Thanks,

    Eric

  68. kvas wrote:

    Hi Eric,

    Maybe you should try use 'update' parameter without 'position'. In this case response will be put into updated container and old containers content will be deleted.

    At the time when I was writing this helper there were only 1.3.x version on jQuery, so .live() is not supported.

  69. senthil wrote:

    I am getting the following error

    Fatal error: Class 'Debugger' not found in /var/www/html/senthil/cakejq/cake/libs/debugger.php on line 252

  70. kvas wrote:

    Hi senthil,
    As you can see in error message it is problem with debugger. I don't know what are you doing wrong, but it isn't bug of helper.

  71. Uchida from Japan wrote:

    uchida from japan wrote:
    2011-01-09 07:42:28
    Thanks for your support so much.
    I have some problem after settings of this one.
    This remoteFunction doesn't work for my cakephp application.
    I have an error like this.
    -----------------------------
    invalid XML markup
    <?=$ajax->remoteFunction(
    -----------------------------

    Please help me and thanks in advance.

  72. kvas wrote:

    Hi Uchida from Japan,
    Maybe you don't have enabled short_open_tags in you php.ini

    Try:
    <?php echo $ajax->remoteFunction(

  73. Uchida from Japan wrote:

    Thanks for kvas.
    It works.^^
    I am a beginner of php.
    Your effort is so great.
    I really appreciate you again.

  74. Arantxa wrote:

    Hello, the first, thank you for this helper.

    Only one thing, when use resizable method with containment in firefox, fail because the call write

    var draggable = $("#draggable").resizable({containment:#parentframe});
    and containment need quotes.

    it's all.

    Bye

  75. kvas wrote:

    Hi Arantxa,

    Thanks for info. Bug is fixed now. You can download updated helper now.

  76. Allanaire wrote:

    For example we have 2 submit buttons. Using Ajax->form how can i know which button is pressed? Thanks

  77. kvas wrote:

    Hi Allanaire,
    Using only my helper it's impossible. But you can write your own different javascript functions for click on submit.

  78. Keyur wrote:

    Hi there i am using the following code and i am getting only text with Open Dialog button. please help.

    View File---------
    <div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
    </div>
    <button id="opener">Open Dialog</button>

    <?=$ajax->dialog('dialog',array('autoOpen' => false))?>
    <script type="text/javascript">
    $(function() {
    $('#opener').click(function() {
    $('#dialog').dialog('open');
    return false;
    });
    });
    </script>

    In my default.ctp i have lines
    echo $html->css('jquery-ui-1.8.4.custom');
    echo $this->Html->script('jquery-1.4.2.min.js');
    echo $this->Html->script('jquery-ui-1.8.4.custom.min.js');
    echo $this->Html->script('jquery.autocomplete.min.js');
    echo $this->Html->script('jquery.jeditable.mini.js');

  79. Keyur wrote:

    Hi there i am using the following code and i am getting only text with Open Dialog button. please help.

    View File---------
    <div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
    </div>
    <button id="opener">Open Dialog</button>

    <?=$ajax->dialog('dialog',array('autoOpen' => false))?>
    <script type="text/javascript">
    $(function() {
    $('#opener').click(function() {
    $('#dialog').dialog('open');
    return false;
    });
    });
    </script>

    In my default.ctp i have lines
    echo $html->css('jquery-ui-1.8.4.custom');
    echo $this->Html->script('jquery-1.4.2.min.js');
    echo $this->Html->script('jquery-ui-1.8.4.custom.min.js');
    echo $this->Html->script('jquery.autocomplete.min.js');
    echo $this->Html->script('jquery.jeditable.mini.js');

  80. Keyur wrote:

    Hi there i am using the following code and i am getting only text with Open Dialog button. please help.

    View File---------
    <div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
    </div>
    <button id="opener">Open Dialog</button>

    <?=$ajax->dialog('dialog',array('autoOpen' => false))?>
    <script type="text/javascript">
    $(function() {
    $('#opener').click(function() {
    $('#dialog').dialog('open');
    return false;
    });
    });
    </script>

    In my default.ctp i have lines
    echo $html->css('jquery-ui-1.8.4.custom');
    echo $this->Html->script('jquery-1.4.2.min.js');
    echo $this->Html->script('jquery-ui-1.8.4.custom.min.js');
    echo $this->Html->script('jquery.autocomplete.min.js');
    echo $this->Html->script('jquery.jeditable.mini.js');

  81. Saeed wrote:

    I am new to cake.
    Its really nice work done by the sweet person/persons.

    Love you all.

  82. Not working wrote:

    Please Specify briefly. step by step how to configure it in cakephp 1.3

  83. me wrote:

    nice helper

  84. Pierre wrote:

    Thank you! Saved me a lot of time!

  85. Jr wrote:

    Hi, I'm having a problem with "PeriodicalExecuter"
    Firefox says: PeriodicalExecuter is not defined

    why is this happening? actually, it is running on my localhost but when i test it on the server with an IP of 192.168.0.80/ then it says not defined. Someone please help.

    Thanks a lot.

  86. Jr wrote:

    Ooopppsss... please disregard my previous post. I already solved it. and i just forgot to add it on the SVN the js files.

    This plugin is cool!

  87. PelleP wrote:

    I keep getting "Uncaught ReferenceError: Ajax is not defined". Any idea what I do wrong?

  88. kvas wrote:

    Hi PelleP,
    Maybe you not including jquery libs in your layout?

  89. PelleP wrote:

    actually I did... at least I got this line when I look at the source code:

    <script type="text/javascript" src="/project/js/jquery-1.4.2.min.js"></script>

    The problem seems to be that I can not use your helper. I would really like to get this to work since I think that the things you´ve done here is awesome.

  90. PelleP wrote:

    GOT IT! sorry for bothering you. I simply putted it in the wrong helpers folder. thanks for great work!

  91. Thumper wrote:

    appears to not work when called inside jquery.lightbox

    any ideas?

  92. kvas wrote:

    Hi Thumper,

    I've never used this helper with jquery.lightbox so I can't help you...

  93. Thumper wrote:

    No worries, thanks for responding though :)

  94. danhtungit2 wrote:

    you can share sourcode to me please!

  95. Bogs wrote:

    The Cake documentation says

    "Migrating from CakePHP 1.2 to 1.3"

    Deprecated Helpers

    Both the JavascriptHelper and the AjaxHelper are deprecated, and the JsHelper + HtmlHelper should be used in their place.

    http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3


    Questions :

    Is this advisable to use in version 1.3.x?
    Will this really work?

    Please help so i can decide what to use..

    Thank you very much

    By the way, nice plugin... ^_^

  96. kvas wrote:

    Hi Bogs,
    If cakePHP will not support old method I'll update my helper, so it's safe to use.

  97. Bogs wrote:

    Hi kvas,

    Thank you, i really want to use this kind of helper... please let me know if you already updated this and it is safe to use... please send me an email.. vestil_v@yahoo.com...

    Thanks a lot, keep it up ^_^

  98. kvas wrote:

    Hi again Bogs,
    You can use it now, When it will be updated it will be backwards compatible.

  99. Bogs wrote:

    hello kvas,

    If i use it now , will the syntax not change after the update? is the way of coding ajax the same ?

    because I read the Cake 1.3 and implemetation of ajax using JsHelper is different

    (like this one)
    $this->Js->get('#myID')->event->(.....)


    thanks for the replies.

  100. kvas wrote:

    Hi Bogs,
    But many people is using this helper now, so when the syntax will be unchanged it'll be easier and faster to migrate.

  101. saleh wrote:

    this supported in CakePHP2?

  102. kvas wrote:

    Hi saleh,
    I didn't have enough time to check it. When I do it I'll give info here.

  103. knocking wrote:

    Hi
    i have some problems using observeField

    <?php
    echo $ajax->observeField( 'ProductSubcategoryId',
    array(
    'url' => array( 'action' => 'get_products' ),
    'update' => 'stock'

    )

    controller :

    function get_products(){
    $id = $this->data['Product']['subcategory_id'];
    $this->set('products',
    $this->Product->FindAllBySubcategoryId($id));
    }
    );
    ?>

  104. knocking wrote:

    view :

    <?php
    if( !empty($products) ){
    $purchase = ...;
    $selling = ..;

    echo "
    <div>$purchase</div>
    <div>$selling</div>";
    }

    ?>


    i'm getting all the page( html body footer) as a result of my request.

    how can i get only the two divs ?.

  105. kvas wrote:

    Hi knocking,

    You should change layout for your controller to 'ajax'.

    In cakephp 1.3 $this->layout('ajax');

  106. knocking wrote:

    thank u

  107. Kani wrote:

    Tnx.When release for cakephp 2.0

  108. kvas wrote:

    Hi Kani,
    In download section you can get new helper version compatible with CakePHP 2.0

  109. gabrielr wrote:

    Congratulations for release this helpful helper for cakephp 2.0.

  110. Thank you very much wrote:

    :)

  111. Kani wrote:

    Thank you very much

  112. Jer wrote:

    Thank you Kvas for release cake 2.0, your work is wonderful !!

  113. Sanjib Dhar wrote:

    Call to a member function link() on a non-object in D:\wamp\www\cakephp2\app\View\Helper\ajax.php on line 309.I got this error while running the in cakephp latest release.

  114. sanjib dhar wrote:

    link is not working I think,remote function is working fine.

  115. kvas wrote:

    Hi sanjib dhar,
    Are you sure that you've downloaded helper for cake2.0 in download section?

  116. Tim wrote:

    Adding this helper (or any helper) breaks my app. What am I doing wrong. I have CakePHP 2.0.6 and followed the instructions to a T, but when I have the line:

    var $helpers = array('Javascript', 'Ajax'); in my AppController I get the following message when I reload the home page:

    Fatal error: Call to a member function create() on a non-object in /Library/WebServer/mcn/app/View/Pages/home.ctp on line 35

    Line 35 is where the following line of code is called:

    <?php echo $this->Form->create('User', array('action' => 'login'));?>

  117. Tim wrote:

    Never mind, I'm an idiot - I didn't realize I had to load the helpers that I never loaded before.

  118. Steven wrote:

    Hi I'm unable to get the ajax helper to work with cakephp 2.0. I have it loaded correctly, and I don't get any errors. However if I try to do something simple like the following:

    <p>Date: <input id="datepicker" type="text"></p>
    <?php $this->Ajax->datepicker('datepicker')?>

    I get nothing but an empty text box...?

    I have:

    echo $this->Html->script('jquery-1.7.1.min'); in my default.ctp file

    public $helpers = array('Time', 'Js', 'Ajax'); in my controller

    What's wrong?

  119. Steven wrote:

    Hi I'm unable to get the ajax helper to work with cakephp 2.0. I have it loaded correctly, and I don't get any errors. However if I try to do something simple like the following:

    <p>Date: <input id="datepicker" type="text"></p>
    <?php $this->Ajax->datepicker('datepicker')?>

    I get nothing but an empty text box...?

    I have:

    echo $this->Html->script('jquery-1.7.1.min'); in my default.ctp file

    public $helpers = array('Time', 'Js', 'Ajax'); in my controller

    What's wrong?

  120. bobzibub wrote:

    Steven, try
    public $helpers = array('Time', 'Javascript', 'Ajax');
    I get a white screen of death whenever Ajax is loaded. Investigating.....

  121. Tobias wrote:

    I have error:

    Fatal error: Call to a member function addScript() on a non-object in /var/www/projects/liber/app/View/Helper/JavascriptHelper.php on line 268

  122. Tobias wrote:

    Working for me:
    //$view =& ClassRegistry::getObject('view');
    $view = ClassRegistry::init('view');

  123. kvas wrote:

    Hi Tobias,
    From cake2.1 you should use $this->Html->script('jquery.min') in your layout file.

    Btw the error you're getting suggest that your helper files aren't included properly.

  124. Tobias wrote:

    Kvas, thank you man! You are nice guy!

  125. Drago wrote:

    First, thank you very much for your efforts. This helper does tho job!
    Just one question, how can I validate for on Ajax submit bu using model validators.

    Thanks

  126. Jer wrote:

    Hello kvas,<br />
    There is a problem for loading the Multibyte class. I have replaced App:import... by this :<br />
    if (!class_exists('Multibyte')) { App::uses('Core','Multibyte');}<br />
    (Javascript Helper - line 296)

  127. tym wrote:

    Hello, i have problem with run this up.

    I try to add $this->Ajax->link() in view and a got an error:

    Call to a member function link() on a non-object in app\View\Helper\AjaxHelper.php on line 310

    In AppController i'm including helpers:
    public $helpers = array('Ajax','Form','Html','Session','Javascript');

    What im doing wrong?

    Thanks for answer.

  128. Carlos Garcia wrote:

    Hi everybody; First of all congratulations to kvas for this, everybody seems to love it.
    I need to implement simple ajax in my cake 2.0 project and find myself wondering why should I use a helper such as this instead of the original than comes with cake. Please bare with me. I'm usign cake 2.0, can anybody give me a hint on how to do a very simple ajax call? I need to pass a string value (from a file input) to the controller -just the string, not the file itself- and need ajax for this since i'm not submitting my form. Can you please take a look at my question here and perhaps help me with this basic ajax call? http://stackoverflow.com/questions/11910292/cakephp-pass-string-to-controler

    I'll be checking here for your help or you can email me at carlosg57@hotmail.com.
    Thank you so much.

  129. sandeep wrote:

    I am using cake2.x

    If i try to implement this i am getting the following errors

    Declaration of AjaxHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\AjaxHelper.php, line 1398]
    Strict (2048): Declaration of JavascriptHelper::value() should be compatible with Helper::value($options = Array, $field = NULL, $key = 'value') [APP\View\Helper\JavascriptHelper.php, line 687]
    Strict (2048): Declaration of JavascriptHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\JavascriptHelper.php, line 687]

  130. رضا شیخله wrote:

    nice , tnks.

  131. Jardix wrote:

    I am using cake2.x

    If i try to implement this i am getting the following errors

    Declaration of AjaxHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\AjaxHelper.php, line 1398]
    Strict (2048): Declaration of JavascriptHelper::value() should be compatible with Helper::value($options = Array, $field = NULL, $key = 'value') [APP\View\Helper\JavascriptHelper.php, line 687]
    Strict (2048): Declaration of JavascriptHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\JavascriptHelper.php, line 687]

  132. Jardix wrote:

    pleaseeeeeeeeee.... :P

    Update the Helper....

    I'm using CakePHP 2.2.x and PHP 5.4 ..!!

  133. Jardix wrote:

    And You should use GitHub..!!

  134. yosi yaffe wrote:

    hi Jardix,

    im developing on cakephp myself
    and i had the same problem.

    there is a workaround :
    in app/config/core.php

    look for line 51 :

    Configure::write('Error', array(...

    in the array : level

    change from :
    'level' => E_ALL & ~E_DEPRECATED,

    to:
    'level' => E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT,

    and it wont fire any more strict notices

    another solution but not as good is :

    in the css file add :
    .cake-error{
    display:none;
    }

    will give u the same effect but not as effective because the system still creates the errors but wont display them so speed is effected.

    if u need more help write ur email.

  135. kvas wrote:

    Hi Jardix,
    This helper isn't fully compatible with cake2.2. I don't know when I find time to rewrite it.
    Actually you try with workaround that yosi yaffe suggested.

  136. Frank wrote:

    Hi, do you also have implementation examples for cakephp / coding newbees ?

    Regards,
    Frank

  137. Mir wrote:

    For those who are getting errors in 2.0 above versions. all you have to do is put $viewFile=null in afterRender function. You should be all good then...

  138. Pls help ... wrote:

    Dude, sry this lame question, but i tried (cake 2.3) umcompress these files kvas_ajax_helper2.0.zip. Put app/view/helper/ as told. Copy some libs to webroot/js (i mean jquery.autocomplete, jeditable, jquery-ui, jquery.min). Added view/Layout/Default.ctp the line <?php echo $this->Javascript->link('jquery-1.4.2.min','jquery.autocomplete.min');?> (right after <head>) tried after <html> and b4 <!DOCTYPE HTML>.
    My controller (revistasController) i wrote function:
    public function autoComplete ($id = null) {
    $this->set('revistas', $this->Revista->find('all', array(
    'conditions' => array(
    'Revista.nome LIKE' => '%'.$this->params['url']['q'].'%'
    ),
    'limit' => $this->params['url']['limit'],
    'fields' => array('nome')
    )));
    $this->layout = 'ajax';
    }

    AppController i put
    class AppController extends Controller {
    var $helpers = array('Javascript', 'Ajax','Form','Html');
    }

    My index.ctp (revistas) i used
    <?php echo $this->form->create('Revista', array('url' => '/ajax/view')); ?>
    <?php echo $this->Ajax->autoComplete('Revista.nome', '/ajax/autoComplete')?>
    <?php echo $this->form->end('Detalhe Revista')?>

    And the css abovre the code in the example (autocomplete).

    Isnt working for me ... If i write anything on the text box to search and cli on the button, it asks me to AjaxController.php file. Is this right ? Do i need this mvc files as well ? Doesnt seems right tough. What can i do to make it works ?

    Ty man.

  139. kvas wrote:

    Hi,

    In your view, you are querying ajax controller: '/ajax/autoComplete'

  140. Sunilal wrote:

    Hi
    I'm using cakephp 2.X
    I'm getting the same error

    Strict (2048): Declaration of JavascriptHelper::value() should be compatible with Helper::value($options = Array, $field = NULL, $key = 'value') [APP\View\Helper\JavascriptHelper.php, line 687]

    Strict (2048): Declaration of JavascriptHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\JavascriptHelper.php, line 687]

    Strict (2048): Declaration of AjaxHelper::afterRender() should be compatible with Helper::afterRender($viewFile) [APP\View\Helper\AjaxHelper.php, line 1398]


    Please help me..!!

  141. kvas wrote:

    Hi Sunilal,
    This helper is a bit outdated so there are problems like that.

  142. Pls Pls Help wrote:

    Hi all,

    i also have same problem with cakephp 2.3 & ajax

    Declaration of JavascriptHelper::value() should be compatible with Helper::value($options = Array, $field = NULL, $key = 'value') [APP\View\Helper\JavascriptHelper.php, line 687]

    is there any new version available for ajax helper ? or is there any other solution ... pls plz help me , i m new in cakephp ....

  143. kvas wrote:

    Hi,
    Actual recommendation is to use build in JsHelper as it has the same functionality as this helper.

  144. Ben wrote:

    Is there any updated version of those helpers?

Post a comment

 

Why should we use jQuery rather than Prototype?

  • It's much faster (as you can see on benchmark)
  • It's light weight
  • CSS3 Compiliant
  • Cross-browser
 

jQuery Ajax Helper

CakePHP is distributed under flexible licence - MIT Licence. I decided to publish my code on the same licence, so you can freely use IT!

If I made you interested go and download it now!