Welcome Guest, Not a member yet? Register   Sign In
CI-> URI problem
#1

[eluser]Fero[/eluser]
Hi,

As much as I appriciate Code Igniter and like to use it, I still have some issues with using it. If anyone may help me with these problems - or misconceptions of MVC approach, I'd be more than happy to listen to more experienced CI programmers.

1. My website build with CI is http://www.fotoramik.sk -> it's a simple blog

The issue is that after I found out the way to remove index.php from URI, I got a problem with paginating. The index webpage is at www.fotoramik.sk however the article must be redirected to www.fotoramik.sk/blog/c/ where blog is class and c is function of that class. After that, the string which selects the articles comes.

So, first page of website doesn't have any segments in URI however the "article" page has 3 of them (blog/c/title-of-article) .

How am I supposed to design the pagination now?

The problem arises when I do it according to so-many tutorials (available online) and www.fotoramik.sk/1 brings 404 page up as CI is looking for class with name "1".

Should I just forget about paginating on index page and show only first few articles, and let the user to click "Clanky transl. Articles" to see other articles?

2. is it a good practice to let controller call the method which would read all necessary data in its constructor, and then pass all the data into the $this->load->view files?
#2

[eluser]amites[/eluser]
1. Sounds like you could use a refresher on the URI class from the User Guide Library section

2. That's one way of doing it, one of the cleaner ways as you can run into dependency issues building everything in libraries and models, though once your more comfortable with MVC and CI it may be a better choice to build controllers with minimal code
#3

[eluser]Fero[/eluser]
1. What do you mean by refresher? -> redirect?? How to use it to solve my problem?

2. Yeah, I'm looking forward to learn how to use libraries and models fully.




Theme © iAndrew 2016 - Forum software by © MyBB