Welcome Guest, Not a member yet? Register   Sign In
T_OBJECT_OPERATOR syntax error
#1

[eluser]CheekyGeek[/eluser]
Greetings all,
Think I've finally wrapped my head around the concepts so ready to write some code and I can't even get my index view to load without getting an error:

Here's the error message:
Code:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /Library/WebServer/Documents/CI/system/application/controllers/user2.php on line 20

Here's line 20:
Code:
this->load->view('user_search_form');
Here's the whole controller (just started):
Code:
<?php
class User2 extends Controller
{

    function User2()
    {
        parent::Controller();
        $this->load->db();
        $this->load->model("Users_model");
        $this->load->scaffolding('users');
        $this->load->helper('url');
        $this->load->helper('form');
    }
    
    function index()
    {
        // called by default with /user2/
        //load view "user_search_form"
        // which calls /user2/search in the form action
        this->load->view('user_search_form');
    }
    
    function search()
    {
        // called with /user2/search
        // searches db table: users with various criteria from view_user_search form. Passed to
        // model: model_users "get" function
        // to populate the view "user_detail_form" (if one record is returned)
        // or populate the view "all_users" (if more than one record is returned)
        $this->load->model('Users_model');
        $data['title'] = 'User Search';
        $data['query'] = $this->Users_model->get();
    
        $this->load->view(all_users);
    }
    
    function list_all()
    {
        // called with user2/list_all
        // displays all users in a table form
        // uses model_users "get" function?
        // to populate the view: all_users
        // last td contains a link to search with user_id (calling user/search/[user_id] )
    }
    
    function user_detail
    {
        // called with user2/user_detail/[user_id]
        // displays one user in a table form by passing user_id to
        // model: model_users "get" function
        // to populate the view: user_detail_form
        // (note: view_user_detail_form will have two submit buttons ("Update" and "Delete")
    }
    
    function delete
    {
        // called with user2/delete/[user_id]
        // asks for confirmation-cancellation before passing user_id to
        // model: model_users "delete" function
        // after deletion, redirect to user2/list_all and add line for to show user_id deleted
    }
    
}

Thanks in advance. I need to get off of these T_OBJECT errors, whatever the heck they are.


Messages In This Thread
T_OBJECT_OPERATOR syntax error - by El Forum - 06-23-2008, 06:56 PM
T_OBJECT_OPERATOR syntax error - by El Forum - 06-23-2008, 07:11 PM
T_OBJECT_OPERATOR syntax error - by El Forum - 06-23-2008, 07:41 PM
T_OBJECT_OPERATOR syntax error - by El Forum - 06-23-2008, 08:21 PM
T_OBJECT_OPERATOR syntax error - by El Forum - 06-23-2008, 09:21 PM
T_OBJECT_OPERATOR syntax error - by El Forum - 06-24-2008, 07:00 AM
T_OBJECT_OPERATOR syntax error - by El Forum - 05-12-2012, 06:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB