Here's what I want to accomplish for my MVC component:
I am on an edit screen and have a link to a controller function that writes a file.
In the controller I need to retrieve the id of the record that was being edited so I can act on it for other queries related to the creation of the $filecontent for the file to be written.
I can't seem to get access to the proper row, either $cid or $id.
Here is what I've tried:
Code:
<?php
global $mainframe, $option;
$id = JRequest::getVar( 'id', 0 );
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
$id = $cid[0];
But when it comes to my query:
Code:
<?php
. ' WHERE mf.podcast_id = '.$id;
$episodes = $db->setQuery( $query );
$episodes = $db->loadObject();
I get nothing.
I have also tried:
Code:
<?php
$model2 = $this->getModel('xmlwrite');
$filecontent = $model2->filename;
Does anyone have some suggestions? How to reach a variable from an edit form.