1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice
  2. If you update to Joomla 3.9.16, you will have to update Fabrik from the latest GitHub version, to fix a bug introduced in Joomla, which makes it impossible to list front end folder locations in backend JForms. This affects things like template selection.
    Dismiss Notice

Value of an Element in PHP

Discussion in 'Community' started by smalldragoon, Mar 24, 2020.

  1. smalldragoon

    smalldragoon Member

    Level: Community
    HI,
    I think I missing something in the logic of naming in Fabriks.
    if there is a documentation which explains clearly, feel free to point it to me. I foudn this one : http://fabrikar.com/forums/index.php?wiki/php-form-plugin/
    for my need :
    I need in PHP validation , before submiting to check a value.
    Context :
    I have a form, which contains 1 group (Addpayee).
    This group contains several elements ( with one named "requiredlvl").
    this element, is a display element, and I want to check its value.

    My understanding is that, during PHP validation, I should get the value thanks to

    $formModel->formData['AddPayee___requiredlvl']

    but obviously nothing....
    Thanks for your insights
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
  3. smalldragoon

    smalldragoon Member

    Level: Community
    mmm... Thanks for the link , I had a look as well.

    I tried previously a " var_dump($formModel->formData["AddPayee___requiredlvl"]" , without success, no output at all. That's why I though I was missing something.

    Just to be sure, if you see any trick in my code :

    JFactory::getApplication()->enqueueMessage('val: ' . var_dump($formModel->formData['AddPayee___requiredlvl']), 'error');


    i'm getting the message in the message queue and displayed , but no var_dump ( nor value with _raw )
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    I don't know.
    Try
    var_dump($formModel->formData['AddPayee___requiredlvl']);exit;
    resp. to see all
    var_dump($formModel->formData);exit;
     
  5. smalldragoon

    smalldragoon Member

    Level: Community
    Finally found the issue. For some reasons ( do not really get it but never mind) , vardump are not displayed with my current template.
    I was looping to the var_dump without "exit" being sure of my code ...
    Final issue is that the group when I created it was named "test", so ... the right variable value was :
    $formModel->formData['test___requiredlvl']
    Thx for your help !
     

Share This Page