Welcome Guest, Not a member yet? Register   Sign In
Scaffolding Path[solved]
#1

[eluser]r@mtbb_[/eluser]
Hello CI-ers,

I've start learning codeigniter this morning, and of course I tried by applying the video tutorials. So, it felt simple until i got to the scaffolding part. I cannot manage mysql table records because scaffolding requests an invalid path (eg. http://localhost/CI/index.php/blog/index...g/delete/0) so I get an extra "index.php/blog/". I am using the latest wamp version, and followed the tutorials step by step. What could be the problem?

Update: I figured I can skip this part and then added records to database manually but now I can't retrive query results neither. The code is exactly as in the tutorial and I get this error:
Quote:Fatal error: Call to a member function get() on a non-object in C:\wamp\www\CI\system\application\controllers\blog.php on line 17

Update2: The scaffolding problem was solved by defining the base path Smile . Now, there's only the get() issue. Here's the code:
Code:
class Blog extends Controller {
    
    function Blog() {
    
        parent::Controller();
        //$this->load->scaffolding('posts');
    }



    function index() {
    
    $data['titlu']='Welcome!';
    $data['continut']='random text random text random text random text';
    $data['query']= $this->db->get('posts');//line 17
    $this->load->view('blog_view',$data);
    
    }


}

Thanks!
//fixed...I wasn't loading the database lib. I was expecting to have that explained in teh tutorial Big Grin
#2

[eluser]Unknown[/eluser]
Same problem here... What exactly do you mean by defining base path?

I echoed BASEPATH and it's currently defined as "C:\wamp\www\CI/system/" does it need to be defined as something else?
#3

[eluser]Michael Wales[/eluser]
1. Visit the Installation Instructions
2. Follow them, specifically #3, as follows:

Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/
$config['base_url']    = "http://127.0.0.1/CodeIgniter/";

A highly likely candidates for this setting:
Code:
$config['base_url']    = "http://localhost/";
#4

[eluser]fender21[/eluser]
Thank you for this post! Fixed my issue ;-)




Theme © iAndrew 2016 - Forum software by © MyBB