У меня есть файл .php с HTML-кодом. Через этот файл я вызываю функцию в другом файле .php, который находится в классе. Звонок не работает. Это просто не вход в функцию в классе.
Ниже приведены коды первого и второго файла соответственно.
<div id="sectionGrid"> <!-- Begin of Grid Section -->
<table id="tblGrid">
<tr>
<?php
require("../Lib/displaygrid.php");
displaygrid::SetGridWithValues("*","electioncategorymaster");
?>
</tr>
</table>
</div> <!-- End of Grid Section -->
Выше приведен только раздел первого файла. Ниже приведен второй файл всего кода:
<script type="text/javascript" src="js_cookiefunctions.js"/>
<link rel="stylesheet" href="DGStyle.css" type="text/css">
<?php
final class displaygrid
{
public static function SetGridWithValues($columnNames,$tableName)
{
echo $columnNames;
require 'obfusGrid.php';
require 'obfusGridSqlDAP.php';
require("../Config/dbconfig.php");
// Load the database adapter
$db = new MySQLAdap(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Load the datagrid class
$x = new MyDataGrid($db);
// Set the query
$x->setQuery($columnNames, $tableName);
// Add a row selector
$x->addRowSelect("SetRowInCookie(%ID%);");
echo $columnNames;
// Apply a function to a row
function returnSomething($ID)
{
return strrev($id);
}
$x->setColumnType('ID', MyDataGrid::TYPE_FUNCTION, 'returnSomething', '%id%');
// Print the table
$x->printTable();
//Show button to return to keywords entry page
echo "<br><input id='backbutton' type='button' value='Back' onclick='ReturnBack()';>";
echo "<script type='text/javascript'>alert(cookie['row_id']);</script>";
}
}
?>
Я также хочу знать, успешно ли ссылки на другие файлы реализованы во втором коде? Я имею в виду тег Link and Script сверху.