0
votes

I am implementing a negation filter field in Symfony 1.4. with 1 text input and 1 checkbox for negation.

I can access the input value as below

public function addXXXColumnQuery($query, $field, $value)
{
    $v = $value['text'];
    $n = 'negation_checkbox_true_or_false'; // don't know how?

    if ($n === true) 
    {
        $query->addWhere($query->getRootAlias().'.name = ?', $v);
    } 
    else if ($n === false) 
    {
        $query->addWhere($query->getRootAlias().'.name <> ?', $v);
    }
}

but I can't figure out how to access the checkbox value.

sfWidgetFormInputFileEditable has a 'with_delete' option that prints a checkbox. Anyone knows where is the code that checks for that value and delete the file?

If I can find that, maybe I can figure that out.

1

1 Answers

0
votes

When you create a sfWidgetFormInputFileEditable with the with_delete option set to true, the widget renders an additional checkbox which is named after the file upload widget with a "_delete" suffix. When the checkbox is checked, the sfParameterHolder of the sfWebRequest object contains a parameter named after the checkbox widget.

So, suppose you have a sfWidgetFormInputFileEditable named "file". In your action, you can see if the delete checkbox is checked using:

$request->hasParameter('file_delete');