Welcome Guest, Not a member yet? Register   Sign In
datamapper1.8 and ci 2.02 : syntax error, unexpected $end ... in admin.php
#1

[eluser]joomigniter[/eluser]
New to Codeigniter :-) First post :-)

I thought I start with the example in Datamapper 1.8.

I installed CI 2.02 and DM 1.8 including the example, but it didn't work. I had to rename Controller to CI_Controller and change the Constructor method to __construct (in the example welcome.php controller). Then I got a message that the encryption key can not be empty. I corrected that as well.

But now I am stuck at the following error message:

Code:
syntax error, unexpected $end in \CodeIgniter\application\controllers\admin.php on line 199

I suspect that the example is not compatible with 2.02. Does anybody have an idea what changes would be required? Thanks for any help in advance!@
#2

[eluser]danmontgomery[/eluser]
You're missing a closing } somewhere.

http://www.google.com/search?q=syntax+er...d+$end
#3

[eluser]WanWizard[/eluser]
I checked the admin.php I have here, but I don't see any missing }...
#4

[eluser]joomigniter[/eluser]
Thanks for your responses.

Correct, nothing is missing. In fact I didn't change anything in admin.php.

Did anybody try the example with CodeIgniter 2.02 and PHP 5.3?
#5

[eluser]joomigniter[/eluser]
This is the only change I did in welcome.php

Code:
<?php

class Welcome extends CI_Controller {

    function Welcome()
    {
        parent::__construct();
        $this->load->library('login_manager');
    }
    
    function index()
    {
        $user = $this->login_manager->get_user();
        // get open bugs, order with most recently updated at the top
        $bugs = $user->bugs;
        $bugs->where_related_status('closed', FALSE);
        $bugs->include_related('status', 'name', TRUE, TRUE);
        $bugs = $bugs->order_by('updated', 'DESC')->order_by_related_status('sortorder')->limit(25)->get_iterated();
        
        $this->output->enable_profiler(TRUE);
        $this->load->view('template_header', array('title' => 'Welcome', 'section' => 'welcome'));
        $this->load->view('welcome/index', array('bugs' => $bugs));
        $this->load->view('template_footer');
    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
#6

[eluser]WanWizard[/eluser]
I'll have to come back on this, no test environment handy at the moment...
#7

[eluser]joomigniter[/eluser]
Ok, understand. Thank your response!

Does anybody have an example for Datamapper 1.8 that works with Codeigniter 2.02? I would appreciate it :-)
#8

[eluser]joomigniter[/eluser]
Figured it out. I had to enable PHP "short tags"
#9

[eluser]WanWizard[/eluser]
Ah, your using an old version of the code. That has been fixed on bitbucket, download 'tip' to get the latest version.




Theme © iAndrew 2016 - Forum software by © MyBB