php - How to change the pagination settings in smarty? -


A clever plugin has an PHP code for applying pages to points.

  & lt ;? Php function smarty_function_pagination_link_01 ($ parameter, & amp; $ smart) {if (is_array ($ parameters ['values'])!) {Return "not array"; } If (0 == count ($ params ['values'])) {return "empty array"; } If (empty ($ params ['values'] ['current_page'])) {return "invalid request"; } $ Value = $ params ['value']; // Separator Betwinn pagination link $ seprator = empty ($ params ['seperator'])? "& Amp; nbsp; & nbsp;" : $ Params ['Separator']; // Category name for $ extra = empty ($ params ['extra'])? "": $ Params ['extra']; $ Current_page = (int) $ value ['current_page']; If (empty ($ values ​​['first'])! // $ retired [] = "& lt; a $ extra href = '{$ values ​​[' first ']}' & gt; & amp; lt; First & lt; / a & gt; "; } If (empty ($ value ['last'])) {$ ret [] = "& lt; one $ extra href = '{$ value [' previous ']}' class = 'last active' & gt; Lt; time & gt; & lt; / span & gt; & lt; / a & gt; "; } $ Ret [] = "& lt; ul & gt;"; foreach ($ k = & gt as $ values; $ v) {if (is_numeric ($ m)) {if ($ K == $ CURRENT_PAGE) {$ retired [] = "& lt; li & gt; & Lt; a $ additional class = 'active'> $ k  & lt; / li & gt; "; } And {$ ret [] = "
  • A $ extra $ = $ $> $ k & lt; / li & gt; ; ($ Values ​​['next']))}}} If {$ retired [] = "

    This function is called from a smart template. Now it is working completely but I want to change the behavior of the above mentioned work, I want to change it back to the value. The value of the argument given above is the value of the $ params as follows:

      Array ([values] => Array ([1] => / xyz / PQR / web / control / module / questions / view_questions.php subject_id = & amp; topic_id = & amp; difficulty_level = & amp; FROM_DATE = 01/02/1999 and TO_DATE = 17/02/2014 in & amp; ; staff_id = & amp; page = 1 [2] = & gt; /xyz/pqr/web/control/modules/questions/view_questions.php?subject_id=&topic_id=&difficulty_level=&from_date=01/02 / 1999 & amp; to_date = 17/02/2014 and Staf_aidi = & page = 2 [3] = & gt; /xyz/pqr/web/control/modules/questions/view_questions.php?subject_id=&topic_id=&difficulty_level=& ; From_date = 01/02/1999 & amp; to_date = 17/02/2014 & amp; staff_id = & amp; page = 3 [Next] => / xyz / pqr / web / control / modu les / questions / view_questions.php? subject_id = & amp; topic_id = & difficulty_level = & Amp; to_date = 01/02/1999 and amp; to_date = 17/02/2014 & amp; staff_id = & amp; p = 2 [final] = & Gt; /xyz/pqr/web/control/modules/questions/view_questions.php?subject_id= & amp; Topic_id = & amp; Di fficulty_level = & amp; FROM_DATE = 01/02/1999 & amp; TO_DATE = 17/02/2014 in & amp; Staff_id = & amp; Page = 8170 [CURRENT_PAGE] = & gt; 1))   

    Now the page numbers display is as follows:! [Enter image details here] [1]

    But I have the following number of candidates:

      1 2 3 4 5 6 7 8 9 10 Next Last   

    How should I get the above pattern by making changes in the function Thanks in advance.

    Try to configure it as num_links like
      $ config ['num_links'] = 10;    

  • Comments

    Popular posts from this blog

    c - Mpirun hangs when mpi send and recieve is put in a loop -

    python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

    java - Unable to get JDBC connection in Spring application to MySQL -