Answer the question
In order to leave comments, you need to log in
I am creating a module with a page in drupal7, why is the page not being created?
I create a module and include it:
function ant_page_reviews_jam_menu()
{
$items = array();
$items['reviewss'] = array(
'page callback' => 'ant_page_reviews_jam_callback',
'menu_name' => 'main-menu',
'page arguments' => array(1, 'result'),
'title' => 'Отзывы', //заголовок страницы
'access callback' => TRUE, //доступ к странице
'type' => MENU_NORMAL_ITEM //тип страницы
);
return $items;
}
function ant_page_reviews_jam_callback()
{
// $result = db_query("SELECT * FROM `reviews_vk` ORDER BY `once_id` ");
// $result->fetchAssoc();
//
$result=123;
return $result;
}
Answer the question
In order to leave comments, you need to log in
Try like this.
function ant_page_reviews_jam_theme() {
return [
'page_theme' => [
'arguments' => array('result' => NULL),
'template' => 'page-theme-template',
],
];
}
function ant_page_reviews_jam_callback() {
$someData = [];
return theme('page_theme', ['someVar' => $someData]);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question