OMG Noob stuck again!!! |
[eluser]JimmyJ[/eluser]
Ok, I've created a browse page that im looking to display database info passed from the id in the url. The url looks like: http://localhost/index.php/browse/2 My browse.php controller looks like this: Code: <?php This gives me the following error: Code: A PHP Error was encountered I have my browse_props.php in the views folder. If I edit the code above and hide the load->view, it will echo "hello" but with a 404 message below? Anyone know what i'm doing wrong? Am I a total noob?
[eluser]tonanbarbarian[/eluser]
Code: function index() should be Code: function Browse() the problem is that the load property of the controller does not exist because it has not be instantiated correctly Once the parent:Controller is called correctly it will make the loader and other default objects available.
[eluser]JimmyJ[/eluser]
Ok, that seemed to work a little: It's now echoing the hello message, but i still get a 404 below the hello. Weird?? My code now looks like this Code: <?php
[eluser]rvent[/eluser]
you need to have the constructor and then the function index Code: class Myclass extends Controller
[eluser]JimmyJ[/eluser]
Think i got it with: Code: <?php by passing the url: http://localhost/index.php/browse/proper...tland.html
[eluser]JimmyJ[/eluser]
Yeh fixed that, now onto: Code: <?php Now trying to figure out, how to pass the region.region_name as the page title outwith the foreach. Any clues????
[eluser]Jon Parker[/eluser]
Its in the User Guide under the db class Code: $query = $this->db->query('SELECT name FROM my_table LIMIT 1'); Code: $row = $query->row();
|
Welcome Guest, Not a member yet? Register Sign In |