English 中文(简体)
从帮助者那里获得《刑法》承认的数据
原标题:Get data from helper in CodeIgniter

I have a trouble with CodeIgniter. I would like to get (recoup) data from a helper that I call in a view. I will explain with the code

我在此认为:

// CALL THE FUNCTION FROM THE HELPER
    <?php recup_email(); ?>

// DATA RECOUP FROM THE HELPER
    <?php foreach($em as $e): ?>
       <?php echo $e->email_membre; ?>
    <?php endforeach; ?>

你可以看到,我称职,在我使用我重新编纂的数据之后。

我的帮助者:

function recup_email()
{
    $CI =& get_instance();
    $CI->load->model( unite_model );

    $data[ em ] = $CI->unite_model->email_membre_model();        
}

但我不知道如何在没有使用的情况下重新整理数据。

    $layout_network[ contenu ] = $this->load->view( list_vote_friend , $data, TRUE);
    $this->load->view( layout_network ,$layout_network); 

由于这一观点已经装满。

I hope you understand, sorry for my bad english. Many thanks.

最佳回答

在你所举的例子中,为什么不只是从帮助者的职能中收回数据?

function recup_email()
{
    $CI =& get_instance();
    $CI->load->model( unite_model );

    $membres = $CI->unite_model->email_membre_model();  
    return $membres;      
}

因此,你认为;

// CALL THE FUNCTION FROM THE HELPER
    <?php $em = recup_email(); ?>

// DATA RECOUP FROM THE HELPER
    <?php foreach($em as $e): ?>
       <?php echo $e->email_membre; ?>
    <?php endforeach; ?>
问题回答

暂无回答




相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

CodeIgniter adding semicolons

How do I stop CodeIgniter adding semicolons ; to data sent via POST that contains ampersand &? For example it is converting "a=1&b=2&c=3" into "a=1&b;=2&c;=3". From looking on the forums ...

Best way to make Admin pages in CodeIgniter?

I m working on an app in CodeIgniter, and I want to have admin pages for several of the objects in the application, and I m wondering what would be the better way to put these into an MVC structure. ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签