@@ -87,29 +87,20 @@ public function __construct($pageParam = 'page', $perPageParam = false)
8787 public function configPagination (?array $ options = [])
8888 {
8989 // trying to us global AutoLoader::configPagination data
90- if (defined ('TAME_PAGI_CONFIG ' ) && is_bool ( TAME_PAGI_CONFIG [ ' allow ' ]) && TAME_PAGI_CONFIG ['allow ' ] === true ){
90+ if (defined ('TAME_PAGI_CONFIG ' ) && TAME_PAGI_CONFIG ['allow ' ] === true ){
9191 $ this ->pagination_settings = TAME_PAGI_CONFIG ;
9292 }else {
93- // create a default data
94- $ this ->pagination_settings = array_merge ([
95- 'allow ' => false ,
96- 'class ' => null ,
97- 'view ' => null ,
98- 'first ' => $ this ->asset ->texts ('first ' ),
99- 'last ' => $ this ->asset ->texts ('last ' ),
100- 'next ' => $ this ->asset ->texts ('next ' ),
101- 'prev ' => $ this ->asset ->texts ('prev ' ),
102- 'span ' => $ this ->asset ->texts ('span ' ),
103- 'showing ' => $ this ->asset ->texts ('showing ' ),
104- 'of ' => $ this ->asset ->texts ('of ' ),
105- 'results ' => $ this ->asset ->texts ('results ' ),
106- 'buttons ' => $ this ->asset ->texts ('buttons ' ),
107- ], $ options );
93+ // merge text options
94+ $ default = array_merge ([
95+ 'allow ' => false ,
96+ 'class ' => null ,
97+ ], $ this ->asset ->texts ());
98+
99+ // remerge view options
100+ $ default = array_merge ($ default , $ options );
108101
109- // get actual view
110- $ this ->pagination_settings ['view ' ] = in_array ($ this ->pagination_settings ['view ' ], $ this ->asset ->views ())
111- ? $ options ['view ' ]
112- : $ this ->asset ->texts ('view ' );
102+ // attach data to property
103+ $ this ->pagination_settings = $ default ;
113104 }
114105
115106 // helps to use one settings for all pagination within applicaiton life circle
@@ -149,6 +140,8 @@ public function links(?array $options = [])
149140 'lastPageLabel ' => $ settings ['last ' ],
150141 'nextPageLabel ' => $ settings ['next ' ],
151142 'prevPageLabel ' => $ settings ['prev ' ],
143+ 'loadMoreLabel ' => $ settings ['load_more ' ],
144+ 'noContentLabel ' => $ settings ['no_content ' ],
152145 'buttonCount ' => $ settings ['buttons ' ],
153146 // Enable AJAX by default with progressive enhancement
154147 'linkAttributes ' => ['data-pagination ' => 'ajax ' ],
0 commit comments