在codeigniter主页面布局中创建母版页布局

时间:2018-05-31 17:47:01

标签: php codeigniter

我正在尝试在护发素中创建母版页布局。但问题是。我收到页面加载错误。

我有Header.php,footer.php,sidebar.php

Dashboar_view.php页面是这个

<?php include_once('common/header.php');?>
<div class="content-wrapper">
    <div class="container-fluid">
      <!-- Breadcrumbs-->
      <ol class="breadcrumb">
        <li class="breadcrumb-item">
          <a href="#">Dashboard</a>
        </li>
        <li class="breadcrumb-item active">My Dashboard</li>
      </ol>

      </div>
<!-- HERE WILL BE ALL PAGE DATA WILL BE SHOWN -->
  <?php $this->load->view($content); ?>
    </div>
    <!-- /.container-fluid-->
    <!-- /.content-wrapper-->
<?php require_once('common/footer.php');?>

这是我的控制器功能Dashboard.php

    public function viewchart()
    {
        $data = array('content'=>'viewchart');
        $this->load->view('admin/dashborad_view',$data);
    }

收到错误

  

无法加载请求的文件:viewchart.php。

关于为页面内容加载创建动态主布局的帮助。 谢谢

1 个答案:

答案 0 :(得分:0)

希望这会对您有所帮助:

如果{ "error": { "code": "AuthorizationFailed", "message": "The client '<CLIENT_ID>' with object id '<OBJECT_ID>' does not have authorization to perform action 'Microsoft.ContainerInstance/containerGroups/exec/action' over scope '/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/slack-bots-v2/providers/Microsoft.ContainerInstance/containerGroups/testing'." } }是您要在信息中心中显示的视图文件夹中的文件

你的控制器应该是这样的:

charts_view.php

您的观点应该是这样的:

public function viewchart()
{
    $chart_content = $this->load->view('charts_view',TRUE);
    $data = array('chart_content'=> $chart_content);
    $this->load->view('admin/dashborad_view',$data);
}

了解更多:https://www.codeigniter.com/user_guide/general/views.html#returning-views-as-data

相关问题