Welcome Guest, Not a member yet? Register   Sign In
Datamapper issues with nestedsets extension
#1

[eluser]Unknown[/eluser]
Trying to setup datamapper nestedsets extension. I'm following this doc: http://datamapper.wanwizard.eu/pages/ext...dsets.html.

But having some issues I'm not sure how to solve. Copied right from the example of how to setup a model and I'm getting an error. Also what is the best way to use this in a controller, I wasn't sure from the documentation if I had the right idea?

Code:
class Categories extends DataMapper {
    $nestedsets = array(
        'name' => 'categoryName'
    );
}

nestedsets is giving this error:


PHP Parse error: syntax error, unexpected '$nestedsets' (T_VARIABLE), expecting function (T_FUNCTION) in /Applications/MAMP/htdocs/application/models/categories.php on line 12

[23-Jul-2013 14:17:27 America/Vancouver] PHP Stack trace:
[23-Jul-2013 14:17:27 America/Vancouver] PHP 1. {main}() /Applications/MAMP/htdocs/index.php:0

[23-Jul-2013 14:17:27 America/Vancouver] PHP 2. require_once() /Applications/MAMP/htdocs/index.php:205

[23-Jul-2013 14:17:27 America/Vancouver] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/system/core/CodeIgniter.php:359

[23-Jul-2013 14:17:27 America/Vancouver] PHP 4. Home->index() /Applications/MAMP/htdocs/system/core/CodeIgniter.php:359

[23-Jul-2013 14:17:27 America/Vancouver] PHP 5. Home->listAWSFiles() /Applications/MAMP/htdocs/application/controllers/home.php:22

[23-Jul-2013 14:17:27 America/Vancouver] PHP 6. DataMapper::autoload() /Applications/MAMP/htdocs/application/controllers/home.php:0
#2

[eluser]WanWizard[/eluser]
You have a PHP error, nothing to do with Datamapper.

If that is supposed to be a class property, you're missing 'var', 'public', etc. If it is supposed to be a variable, it has to be defined in a method.
#3

[eluser]Unknown[/eluser]
Ok, that is kind of what I was thinking. So it means the documentation has an error in it.
#4

[eluser]WanWizard[/eluser]
Possibly.

Datamapper is no longer maintained at the moment. I don't have time for it anymore, haven't used CI in years. But nobody seems to be intrested to take over the maintenance.




Theme © iAndrew 2016 - Forum software by © MyBB