Hello
I've been trying for a while to add php variable to the <param name="flashvars" /> for the flash object.
I'm finally close to it as I can pass to the template the value returned by my flashvarFunction() that way :
<param name="flashvars" value=$flashvarFunction/>
This works fine but now I want to do the same thing based on the dataobjectmanager example with let's say the Author or Quote value.
I'm not a php coder so I find it hard bur I'm sure there is a way of returning those value
Can someone help me ?
Thanks a lot
Here is the code
<?
class TestimonialPage extends Page
{
static $has_many = array (
'Testimonials' => 'Testimonial'
);
public function getCMSFields()
{
$f = parent::getCMSFields();
$f->addFieldToTab("Root.Content.Testimonials", new DataObjectManager(
$this,
'Testimonials',
'Testimonial',
array('Author'=>'Author','Quote' => 'Quote'),
'getCMSFields_forPopup'
));
return $f;
}
}
class TestimonialPage_Controller extends Page_Controller
{
function ShowTestimonials() {
return DataObject::get('Testimonials','Quote','Author');
}
function flashvarFunction() {
$flashVar="'myFlashVar=titopt'" ;
return $flashVar;
}
}