How to link a href when using CodeIgniter's $this->table->add_row ?

Eduardo Fuerte
Eduardo Fuerte used Ask the Experts™
on
Hi Experts!

Could you point how to link a href  in this structure by using CodeIgniter?

<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
	           echo "<div class='form-group-ppais'>	
			
			<div class='tabela_ppais'>";
             
                	if(empty($resultadoIcaEncerrados)){
                		echo 'No momento, não encontram-se cadastrados editais PPAIS. ';
                	}else{
                		$table = array (
					                    'table_open'          => '<table class="table table-hover" name="procurarnoticia" id="procurarnoticia">',
					                    'table_close'         => '</table>'
              							);
					$this->table->set_template($table);
                    
                    $this->table->set_heading('Chamada', 'Org&atilde;o','Abertura', 'Fechamento');
                    	
                    foreach($resultadoIcaEncerrados as $linha){
                                   
                        $this->table->add_row($linha->nome_orgao, $linha->nome_programa, $linha->dt_abertura, $linha->dt_fechamento);
                    }
					 echo $this->table->generate();
					}
					//echo "<br/><a class='btn btn-primary'  href='";echo base_url("acesso_usuarios/procurarAcessosPorData");echo "'>Voltar</a>";
                ?>
                
        </div>
    </div>

</div>
</div>

Open in new window


What I need is that  the column represented by:

 $linha->nome programa

have this link:

           echo "<a  href='";
              echo base_url("arquivos/ica/chamadas/".$pasta."/$edital")."'";;
              echo ' target="_blank"';
              echo ">";echo($resultadoIca->nome_orgao);
        ?>

Open in new window


Thanks in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Just put the code in a variable and then use that in the add row call
$cell = "<a  href='";
$cell .= base_url("arquivos/ica/chamadas/".$pasta."/$edital")."'";
$cell .= ' target="_blank"';
$cell .= ">";
$cell .= $resultadoIca->nome_orgao;

$this->table->add_row($linha->nome_orgao, $cell, $linha->dt_abertura, $linha->dt_fechamento);

Open in new window

Eduardo FuerteDeveloper and Analyst

Author

Commented:
Perfect!

Thank you very much!

If possible, could you give a look at ?

http://www.experts-exchange.com/questions/28879919/How-to-make-a-label-and-radio-buttons-beeing-inline.html
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You are welcome.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial