5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 142 Views |
-
[SOLVED]Trying to extend ModelAdmin error

15 January 2013 at 7:16pm
Hello,
I try to follow the ModelAdmin but I don't totally understand what I should do and getting errors.
What I did:
Created a files in msite/code
1. Donation.phpclass Donation extends DataObject
{
static $db = array('Name'=>'Varchar(100)');
static $has_one = array('DonationAmount' => 'Amount');
}2. DonationAmount.php
class DonationAmount extends DataObject
{
static $db = array('Amount'=>'Varchar(100)');
static $has_many = array('Donations' => 'Donation');
}3. ClunyDonations.php
class ClunyDonations extends ModelAdmin
{
public static $manage_models = array('Donation', 'DonationAmount');
static $url_segment = 'donations';
static $menu_title = 'Donations';
}In my admin menu I now see Donations, but clicking on it I get this error:
ModelAdmin::getManagedModels():
You need to specify at least one DataObject subclass in public static $managed_models.
Make sure that this property is defined, and that its visibility is set to "public"
IN GET /clunysilver/admin/donations/
Line 277 in C:\wamp\www\clunysilver\framework\admin\code\ModelAdmin.phpWhat am I missing?
-
Re: [SOLVED]Trying to extend ModelAdmin error

15 January 2013 at 9:30pm
Hi,
Seems like you have a typo:)
Use :
public static $managed_models = array('Donation', 'DonationAmount');
instead of:
public static $manage_models = array('Donation', 'DonationAmount');
-
Re: [SOLVED]Trying to extend ModelAdmin error

15 January 2013 at 10:40pm
Oh dear, these stupid silly spelling mistakes....
*blush*
Thank you
| 142 Views | ||
|
Page:
1
|
Go to Top |


