I need to get a variable from another class in the same file, for a widget I am making.
GalleryUpload.php
class GalleryUpload extends Widget {
static $db = array(
"GalleryName" => "varchar", //gallery name
"Location" => "varchar", //location of folder to upload files to
"Redirect" => "varchar" //landing page after user uploads image
);
...
}
class GalleryUpload_Controller extends Controller {
...
function doForm($data, $form) {
$file = new File();
$file->loadUploaded($_FILES['FileTypeID'], "/galleries/" . $this->Location ); // HERE
// Redirect to a page thanking people for registering
Director::redirect( $this->Redirect ); // HERE
}
}
On the lines that say "//HERE" are the variables I need from above. I have tried several things, just to see if it would work, but no luck.
How could I get the variables from "class GalleryUpload" into "class GalleryUpload_Controller"?