Welcome Guest, Not a member yet? Register   Sign In
Codeigniter + smarty problem with pass variable template to model
#4

I fix the problem in this way:

MY_Controller.php
PHP Code:
class MY_Controller extends CI_Controller {
        public function 
__construct(){
                
parent::__construct();
                
$this->information();
        }
        public function 
information() {
                
$this->load->helper('info');
        }


Model:
PHP Code:
    public function info_site($name) {
        
$db $this->load->database('site'TRUE);
        
$db    ->select('value')
                        ->
from('arcor_site_setting')
            ->
where('name'$name);
        
$query_info_view $db->get('');
        foreach (
$query_info_view->result() as $row){
            echo 
$row->value;
        }
    }


helper:
PHP Code:
function Info($name) {
    
$CI get_instance();
    
$CI->load->model('informations');
    
$CI->informations->info_site($name);


PHP Code:
{info(name)} 
Reply


Messages In This Thread
RE: Codeigniter + smarty problem with pass variable template to model - by StratoKyke - 07-06-2015, 10:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB