1. Go to this page and download the library: Download fsi/datagrid library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
<table>
<tr>
foreach ($view->getColumns() as $column):
$columns = $view->getColumns();
foreach ($columns as $column) {
// this will give you access to ``HeaderView`` object.
echo $column->getLabel();
}
// this will give you access to ``CellView`` object.
$cell = $view['name'];
echo $cell->getValue();
php
namespace FSi\SiteBundle\Entity\News;
class News
{
/**
* @var integer
*/
protected $id;
/**
* @var string
*/
protected $title;
/**
* @var string
*/
protected $author_name;
/**
* @var string
*/
protected $author_surname;
/**
* @var string
*/
protected $author_email;
/**
* @var DateTime
*/
protected $publication_date;
public function getId()
{
return $this->id;
}
public function getTitle()
{
return $this->title;
}
public function getAuthorName()
{
return $this->author_name;
}
public function getAuthorSurname()
{
return $this->author_surname;
}
public function getAuthorEmail()
{
return $this->author_email;
}
public function getPublicationDate()
{
return $this->publication_date;
}
/*
Here we should have setters
public function setTitle($title)
public function setAuthorName($name)
...
*/
}