Answer the question
In order to leave comments, you need to log in
How to correctly implement a selection from the database?
How to correctly implement on each page of the site you need all 4 arrays from the database selection
I think when loading any page 4 requests to the database will give a load
. If cached, then how?
All data is dynamic and edited in the admin panel, you will need to update the table + cache after each editing
<?php
namespace MyApp\Controllers;
use Phalcon\Mvc\Controller;
use MyApp\Models\Pages as Pages;
use MyApp\Models\Categories as Categories;
use MyApp\Models\Items as Items;
use MyApp\Models\Settings as Settings;
class ControllerBase extends Controller
{
$this->view->pages = Pages::find();
$this->view->categories = Categories::find();
$this->view->items = Items::find();
$this->view->settings= Settings::find();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question