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

  • SEARCH
  • Home
  • 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 8498195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:20:10+00:00 2026-06-11T00:20:10+00:00

In controller I’m getting array of news from web-service $news = json_decode(@file_get_contents($submenu), true); and

  • 0

In controller I’m getting array of news from web-service $news = json_decode(@file_get_contents($submenu), true); and I need to paginate this array to 6 news per page. My array’s structure:

array(
    (int) 0 => array(
        'id' => '716',
        'city_id' => null,
        'language' => 'lit',
        'header' => 'Lorem ipsum dolor sit amet.',
        'description' => '<p>Sed  diam  nonummy nibh euismod tincidunt ut laoreet dolore magna.',
        'short_description_img' => '',
        'autor' => 'Avio',
        'friendly_link' => 'Lorem_ipsum_dolor_sit_amet_1346393036',
        'created' => '2012-08-31 09:03:56',
        'general_tag' => array(
            'id' => null,
            'agency_id' => null,
            'project_id' => null,
            'active' => null,
            'language' => null,
            'title' => null,
            'friendly_link' => null,
            'healthcare_trip_tag' => null,
            'created' => null
        ),
        'tags' => array()
    )
        (int) 1 => array(
        'id' => '717',
        'city_id' => null,
        'language' => 'lit',
        'header' => 'Lorem ipsum dolor sit amet.',
        'description' => '<p>Sed  diam  nonummy nibh euismod tincidunt ut laoreet dolore magna.',
        'short_description_img' => '',
        'autor' => 'Avio',
        'friendly_link' => 'Lorem_ipsum_dolor_sit_amet_1346393036',
        'created' => '2012-08-31 09:03:56',
        'general_tag' => array(
            'id' => null,
            'agency_id' => null,
            'project_id' => null,
            'active' => null,
            'language' => null,
            'title' => null,
            'friendly_link' => null,
            'healthcare_trip_tag' => null,
            'created' => null
        ),
        'tags' => array()
    )
         .................
)

Tried default pagination method as shown in CakePHP documentation but no luck. Thanks for advices

  • 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-06-11T00:20:11+00:00Added an answer on June 11, 2026 at 12:20 am

    you can copy cake/Controller/Component/PaginatorComponent.php to app/Controller/Component/PaginatorComponent.php , then override the paginate function in it.
    By Simple changes you have array paginator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

controller $data[controller] = $table; $data[rows] = $this->base_model->get();//get table attributes and names $write_add = $this->load->view(generate/add,$data,TRUE);//load
Controller First I tried this: [HttpPost] public ActionResult Edit(JournalEntry journalentry) { if (ModelState.IsValid) {
My controller get datas from database model, and sends them to view. In view
The controller function: function signup() { $bool1 = $this->form_validation->run('username'); $bool2 = $this->form_validation->run('email'); $bool3 =
Inside Controller I need to get a rendered string and do some actions with
CONTROLLER class ImagesController extends AppController { var $name = 'Images'; var $uses = array('Image','Person');
//Controller code CookieContainer cookieContainer = new CookieContainer(); //makes new cookie here cookieContainer.Add(myCookie); //Service/Facade code
Every controller class in my project derive from a base controller class, aptly named
Controller function delete_payment($payment_id) { $this->sale_lib->delete_payment($payment_id); $this->_reload(); } View <?php echo anchor(sales/delete_payment/$payment_id,'['.$this->lang->line('common_delete').']');?> It is possible
my controller is like this $content = View::factory('user/biochemistryTestForm') ->bind('result', $result); $this->template->content = $content; //here

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.