Avatar of Eduardo Fuerte
Eduardo Fuerte
Flag for Brazil

asked on 

Could you clear what must be done for Codeigniter scope a variable correctly?

Hi Experts!

I'm facing a problem related with variable scope in Codeigniter

Controller code:
		public function compraspublicas($ano=false,$mes=false){
			$buscatesteira['buscatesteira'] = $this->home_model->getTesteira(3);
            $data2['title'] = "ICA - COMPRAS PÚBLICAS";
            $quantidade = 10;
            $resultadoIca['resultadoPublicacoes'] = $this->icahome_model->
            //$paginacao['paginacao'] = $this->pagination->create_links();


Open in new window

Model Code

public function getEditais($id){
            $sql = "SELECT nome_edital FROM tb_editais_orgao";
            $result = $this->db->query($sql);
            return $result;

Open in new window

View code

<div class="tab" id="tab1" style="display: block;">
      <p>Conteudo da tab1 - Qualquer HTML válido pode preencher</p>
     if (empty($resultadoIca))
          echo 'No momento, não encontram-se cadastrados editais. ';
        echo 'Existem editais. ';
      // This causes errors
      foreach ($resultadoIca as $resultadoIca)

        echo 'Edital';



Open in new window

The table has values for the query


The variable $resultadoIca is not visible in the view code....

Could you point what could be necessary to that?
(if any other directive is necessary)

Thanks in advance!
CSSPHPWeb FrameworksjQueryJavaScript

Avatar of undefined
Last Comment
Eduardo Fuerte

8/22/2022 - Mon