Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6932849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:45:28+00:00 2026-05-27T11:45:28+00:00

I am a totally noob at CakePHP and have been dealing with this site

  • 0

I am a totally noob at CakePHP and have been dealing with this site update from traditional php to CakePHP. In the old website there was a folder for javascript and in there, there was a file called paging.js, then, at then end of where i was doing the table loops and stuff you would add this

  echo '<div id="pageNavPosition"></div>
        <div>&nbsp;</div>';    



  echo "<script type='text/javascript'><!--
        var pagerAdmin = new PagerAdmin('results', 5); 
        pagerAdmin.init(); 
        pagerAdmin.showPageNav('pagerAdmin', 'pageNavPosition'); 
        pagerAdmin.showPage(1);
    //--></script>";
  }

In that website works perfectly, it shows only 5 records and with pagination. But now here in cake PHP I have thi code in my view but its not picking up that portion of code

  <?php

        echo '<div><h3>Admin - Update Data</h3><p>To update data click on name</p></div>';
        print("<table id='results'><tr><th>ID</th><th>Image</th><th>Name</th><th>Price</th><th>Description</th></tr>");

         $i =0;
         foreach ($dishes as $key => $dish):

         print("<tr>");   
         print("<td width='20px'>");
         echo '<p style="font-size:14px; color:blue; padding:0;">'.$dishes[$i]['Dish']['id'].'</p>';
         echo '<input type="hidden" name="'.$dishes[$i]['Dish']['dish_name'].'" value="'.$dishes[$i]['Dish']['id'].'" id="DishDishId" />';
         print("</td>");          
         print("<td width='10px'>");
         print("<img class='custom_rate' alt='' src='/myweb/img/".$dishes[$i]['Dish']['dish_image']."' />");
         print("</td>");
         print("<td width='100px'>");
         print("<a href='index.php?form_type=admin_manager&id=".$dishes[$i]['Dish']['id']."'>".$dishes[$i]['Dish']['dish_name']."</a> ");
         print("</td>");
         print("<td width='100px'>");
         print($dishes[$i]['Dish']['dish_price']);
         print("</td>");
         print("<td width='100px'>");
         print($dishes[$i]['Dish']['dish_disc']);
         print("</td>");
         print("</tr>");
         $i++; 
         endforeach;
          print("</table>");

          if($i> 5)
          {
             echo '<div id="pageNavPosition"></div>
                   <div>&nbsp;</div>';    



            echo "<script type='text/javascript'>"  ;
            echo   "var pagerAdmin = new PagerAdmin('results', 5);"; 
            echo   'pagerAdmin.init();';
            echo   "pagerAdmin.showPageNav('pagerAdmin', 'pageNavPosition');"; 
            echo   'pagerAdmin.showPage(1);';
            echo '</script>";';
        }


          ?>

Any idea how i can make this work again? .Any help would be much appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:45:28+00:00Added an answer on May 27, 2026 at 11:45 am

    For anyone who runs into this issue, you just need to create a separate .js file and place it in the webroot/js folder with your js code. Then reference it as follows

    echo $this->Html->script('myjasfile.js');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally a PHP noob here so sorry for the possibly basic question - here
Totally confused by this one... We have a WAMPServer installation set up, running a
Firstly: I am totally a newbie for this kind of work. I have a
I am totally a noob to this area, is it possible to play a
Totally revising this question, since I fixed the first issue but have ran into
Totally new to Cake. I have this table named Content and another one named
Totally confused about the data types required here. I have this Linq statement: var
Ok. very much totally noob question but I really don't have a clue and
Ok, this might be a very noob question, but I find that PHP Documentation
I am a totally noob in writing jUnit tests. I have an Android program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.