Welcome Guest, Not a member yet? Register   Sign In
Show a single blog post?
#11

[eluser]afterspark[/eluser]
Thanks again for the reply.

I've read the URL user guide and I'm trying to grasp it.

What confused me about the code you posted was that it only used 2 segments in the URL, where as the user guide says CI uses 3 (/class/function/ID).

I did get your code to work, but only after I specifically called $this->uri->segment(2); as the ID of the post.

I was just curious if I did something wrong.

Thanks again.
#12

[eluser]Nick Husher[/eluser]
Ah, yeah, typo on my part.

That second url should be <your_ci_app>/blog/index/5.

Index is the default function to be called when you call a controller, but you need the function name in there if you're passing arguments. Unless you do some fancy routing stuff.
#13

[eluser]afterspark[/eluser]
Ok I'll give that a try, just wanted to make sure I wasn't doing something incorrect.

Thanks again for your help it is really appreciated!
#14

[eluser]afterspark[/eluser]
I got your code to work by modifiying it with some code I got from the user guide, however I'm still working on the code you provided trying to get it to work, and here is the problem I keep running into.

Undefined variable: data
Message: Undefined variable: data
Filename: controllers/blog.php




Theme © iAndrew 2016 - Forum software by © MyBB