Answer the question
In order to leave comments, you need to log in
How to make CNC in CodeIgniter?
Hello. Can you please explain how CNC works in CI? I have already read the documentation. Here I have mysite.ru/main/page/10 - I want it to be mysite.ru/novosti
As I understand it, you need to create a separate novosti controller and do CNC through the route. Is it possible without creating a controller? As a result, pages will be created from under the admin panel - and creating a controller for each page - well, it won’t work.
Answer the question
In order to leave comments, you need to log in
mysite.ru/main/page/10 - I want it to be mysite.ru/novosti
class Main extends CI_Controller
{
function page($page_id)
{
/* Тут ваш код. */
}
}
We do this, for each page, based on the title, a title_url is formed
from the route, this title_url is taken and searched in the
route.php
Pages Controller database
function index($title_url){
// Поиск нужной страницы
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question