Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Admin Console issue


Reply


2 Posts   462 Views

Avatar
K_T

Community Member, 8 Posts

9 August 2012 at 2:07am

Edited: 09/08/2012 2:21am

Hi All,

I have created a Simple tab in SS Admin below is the code

Days.php
<?php
class AddDays extends DataObject {

static $db = array(
'day_title' => 'Varchar(100)',
'day_date' => 'Date'
);

static $searchable_fields = array(
'day_title'
);

static $summary_fields = array(
'day_title',
'day_date',

);

}
?>

and for Admin

<?php
class DayAdmin extends ModelAdmin {

public static $managed_models = array(
'AddDays '
);

static $url_segment = 'daylocator';
static $menu_title = 'Add Days';

}
?>

fine upto this point I can add the Days from Admin as well but when i try to delete the data I got this warning message

Deprecated: Function ereg_replace() is deprecated in /sapphire/core/control/Director.php on line 494
Number of elements must be positive ......
EDIT:Forgot to mention I am a PHP beginner

Any Hints why is it behaving so

Thanks in Advance
K_T

Avatar
K_T

Community Member, 8 Posts

9 August 2012 at 5:37pm

Fix

http://www.silverstripe.org/customising-the-cms/show/16060#post308730