1. Go to this page and download the library: Download pawellen/listing library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pawellen / listing example snippets
$bundles = array (
(...)
new PawelLen\DataTablesListing\DataTablesListingBundle()
);
2,5. Configuration:
data_tables_listing:
default_template: LenPanelBundle::listing_div_layout.html.twig
s twig function.
Example:
/**
* @Route("/user/list")
* @Template()
*/publicfunctionlistAction(Request $request){
// Creates new listing object:
$list = $this->get('listing')->createListing(new UserListing(), array(
'request' => $request
));
// Handle ajax request that provide data to listing:if ($request->isXmlHttpRequest()) {
return $list->createResponse($request);
}
// Pass ListView object to your template:returnarray(
'list' => $list->createView()
);
}