grid.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCoreSamples Samples
  7. * @{
  8. */
  9. /**
  10. * @page samples
  11. * @section grid Grid
  12. */
  13. /**
  14. * Please refer to the following file for custom class and SQL dump data for this example:
  15. * @see BxGridMy.php
  16. */
  17. $aPathInfo = pathinfo(__FILE__);
  18. require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
  19. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  20. $oTemplate = BxDolTemplate::getInstance();
  21. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  22. $oTemplate->setPageHeader ("Sample grid");
  23. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  24. $oTemplate->getPageCode();
  25. /**
  26. * page code function
  27. */
  28. function PageCompMainCode()
  29. {
  30. ob_start();
  31. $oGrid = BxDolGrid::getObjectInstance('sample'); // it automatically creates instance of default or custom class by object name
  32. if ($oGrid)
  33. echo $oGrid->getCode(); // print grid object
  34. return DesignBoxContent("Sample grid", ob_get_clean(), BX_DB_PADDING_DEF);
  35. }
  36. /** @} */