View database column - Parser Codeigniter 4

Asked

Viewed 11 times

0

Good afternoon!

I’m needing to display a database column, through the parser within a IF, how can I do this?

I am passing an array and rendering with the parser, code below:

    $dados = [
        "certificadoDigital"    => $this->certificado->where('cnpj', $buscaCnpj['cnpj'])->first()
    ];

    echo $this->parser->setData($dados)->render("configuracao");

In the "configuration" file I am doing a check to see if the array really has record in the database.

 {if empty($certificadoDigital)}

<span> Certificado não inserido </span>

{else}

<span> Certificado inserido </span>

{endif}

In the database certificado has three columns (id, arquivo , cnpj), through this, as I can call this column inside the parser. For example {$certificadoDigital['arquivo']} ?

Thank you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.