Welcome Guest, Not a member yet? Register   Sign In
Pagination & routes
#11

[eluser]Guerra[/eluser]
I write:
Code:
$config['base_url'] = base_url();
Code:
$config['uri_segment'] = 1;
Links are created but 404 Confusedhut:
#12

[eluser]Guerra[/eluser]
When config pagination we specify in
Code:
$config['base_url']
full path
Code:
base_url()
+ controller name + function.... And display number of pages goes in 3 uri segment. How to make that page numbers displayed in first uri segment?
#13

[eluser]Dam1an[/eluser]
So you want you're site url + number + conftroller + function, so edit the lines I mentioned earlier to be someling like
Code:
$output = $this->num_tag_open.'<a >config->slash_item('site_url').$loop.'/'.$this->base_url.'">'.$loop.'</a>'.$this->num_tag_close;
(Note: not tested, but you get the idea, now do it for the other links)

I reused the base_url you pass in which represents the part you want to appear after the digit (too lazy to create new variables)
#14

[eluser]Guerra[/eluser]
It is good, but i need only site url + number without conftroller + function.... Can be to make across substr() ?
#15

[eluser]Dam1an[/eluser]
So you will only ever have one controller/fnction which will need pagination, and no other routes which will be just a number?
#16

[eluser]Guerra[/eluser]
Controller one :cheese:
Necessary:
site url + category_name + number
site url + category_name + full_top + number - if many comments
:bug:
#17

[eluser]Dam1an[/eluser]
Wait, so all along you where saying you wanted segment 1 to be the number, and now you want to put one or two things in front of it? Now I'm confused... and whats full_top?
#18

[eluser]Guerra[/eluser]
I need: site url + number - for index function (1 uri segment pagination) and site url + category + number - for category function (2 uri segment pagination). But at first it is necessary to understand with site url + number
#19

[eluser]Guerra[/eluser]
I did manipulations with substr() function, but the result is not present Sad
#20

[eluser]Dam1an[/eluser]
What code have you got using substring? and what do you mean by the result is not present? It gives nothing, or not what you expect?

The code I gave earlier will work, but for the first case, pass in nothing as base_url, so it will end up being site_url/number, and remember, you need to create a route for it to work




Theme © iAndrew 2016 - Forum software by © MyBB