protected function setUp() { date_default_timezone_set('America/Recife'); $this->config = new Config(); $this->config->setClass("display")->setDisplayLength(static::DISPLAY_LENGHT)->setPaginationEnabled(true)->setLengthChangeEnabled(true)->setFilterEnabled(true)->setInfoEnabled(true)->setSortEnabled(true)->setAutoWidthEnabled(true)->setScrollCollapseEnabled(false)->setPaginationType(Config::PAGINATION_TYPE_FULL_NUMBERS)->setJQueryUIEnabled(false)->setServerSideEnabled(true)->setAjaxSource('/list'); $_GET['iDisplayLength'] = 10; $_GET['iDisplayStart'] = 0; $_GET['sEcho'] = 1; $_GET['sSearch'] = 'test'; }
/** * Build the array for the 'oLanguage' option from the LanguageConfig object * * @return array */ protected function renderLanguageConfig() { $pagination = LanguagePagination::fromConfig($this->config->getLanguageConfig()); $options = LanguageOptions::fromConfig($this->config->getLanguageConfig()); $options->setOPaginate($pagination); return $options; }
public static function fromConfig(Config $config) { $options = new self(); return $options->setBPaginate($config->isPaginationEnabled())->setBLengthChange($config->isLengthChangeEnabled())->setBProcessing($config->isProcessingEnabled())->setBFilter($config->isFilterEnabled())->setBSort($config->isSortEnabled())->setBInfo($config->isInfoEnabled())->setBAutoWidth($config->isAutoWidthEnabled())->setBScrollCollapse($config->isScrollCollapseEnabled())->setBScrollInfinite($config->isScrollInfiniteEnabled())->setIDisplayLength($config->getDisplayLength())->setBJQueryUI($config->isJQueryUIEnabled())->setSPaginationType($config->getPaginationType())->setBStateSave($config->isSaveStateEnabled())->setICookieDuration($config->getCookieDuration())->setAsStripClasses($config->getStripClasses())->setBServerSide($config->isServerSideEnabled())->setSAjaxSource($config->getAjaxSource())->setSScrollX($config->getScrollX())->setSScrollY($config->getScrollY())->setIScrollLoadGap($config->getScrollLoadGap())->setSCookiePrefix($config->getCookiePrefix())->setSDom($config->getDom()); }