codeigniter 我想把下面一行的o/p传入控制器ie〈?php echo $module[$i]->im_name;?>

fhg3lkii  于 2022-12-07  发布在  PHP
关注(0)|答案(1)|浏览(82)

这是我的代码:

if (count($template) >=1) { ?>  

    <div class="mdl-cell mdl-cell--4-col" id="select">
        <div class="mdl-card mdl-shadow--4dp">
            <div class="mdl-card__title">
                <h2 class="mdl-card__title-text">select <?php echo $module[$i]->im_name; ?> Template</h2>
              </div>
            <div class="mdl-card__media">
                <?php echo $template[0]->iut_tempname; ?>

            </div>

            <a href="<?php echo base_url("Account/template_list/"); ?>" class="btn btn-info btn-lg">
                    <span class="glyphicon glyphicon-cog"></span>
            </a>

        </div>
    </div>  

    <?php

        }

我要传递此im_name的o/p;?〉到控制器。

carvr3hs

carvr3hs1#

希望这对您有所帮助:

在views文件夹中创建一个文件夹uploads,并将VIEWPATH用于upload_path,如下所示:

$config['upload_path']  = VIEWPATH.'uploads/';

您的代码应该如下所示:

if (isset($_FILES["image_file"]["name"])) 
{

    $config['upload_path']  = VIEWPATH.'uploads/'; 
    $config['allowed_types']= 'txt|php|html';

    $this->load->library('upload', $config);
    $this->upload->initialize($config);

    if (!$this->upload->do_upload('image_file')) 
    {
        echo $this->upload->display_errors();
    }
    else
    {
        $data = $this->upload->data();
        echo '<img src="'.base_url().'uploads/'.$data["file_name"].'" />';  
    }
}

更多信息:https://www.codeigniter.com/user_guide/general/reserved_names.html

相关问题