Hi everyone!
I would like to programatically (so with no frontend or backend form) add a new record to my cobalt website. As I understand I can do this by 'mimicing' the form and using a controller:
$_POST['jform']['title'] = $mytitle;
$_POST['jform']['category'] = $mycategoryid;
$_POST['jform']['section'] = $mysectionid;
$controller = JControllerLegacy::getInstance('Cobalt');
$controller->execute('record.save');
$controller->redirect();
First of all, is there a way of doing this easier? As in not mimicing the form and just having a simple function?
But my main question is: How can I fetch the ID of the record that was just created?
Thanks!
JB
Hi everyone!
I would like to programatically (so with no frontend or backend form) add a new record to my cobalt website. As I understand I can do this by 'mimicing' the form and using a controller:
First of all, is there a way of doing this easier? As in not mimicing the form and just having a simple function?
But my main question is: How can I fetch the ID of the record that was just created?
Thanks!
JB