php - Display the result of a function in codeigniter view -
in index function of controller calling getdircontents , need display result of $data['arrdircontents'] in view
public function index() { $this->accesscontrol->can_or_redirect('view', 'translation'); $dir = './application/language/english'; $data['arrdircontents']=$this->getdircontents($dir, "~^.+_lang\.php$~i"); $this->output->view('translation/language',$data); } any on how result of function in view?
<?php $dir = './application/language/english'; $data['arrdircontents']=$this->getdircontents($dir, "~^.+_lang\.php$~i"); ?>
if values contents single value means
in view page echo
<?php echo $arrdircontents; ?> if values contents multiple value having array value foreach print each variable value
<?php foreach( $arrdircontents $directs): echo $directs; endforech; ?>
Comments
Post a Comment