-1

My URL is:

http://localhost/CodeIgniterCms/admin/dashboard/otherpages/123 where,

Codeigniter Cms

- admin

-- dashboard (the controller)

--- otherpages (Method)

Controller code

public function otherpages($somedata) {
   $this->render('admin/second_view',$somedata);
}

Code in second_view.php

<pre>
   <div class="container">
     <?php echo $somedata;?>
    </div>
</pre>

But it is throwing error
Unable to load the requested file: admin/123.php

3
  • Do you have any special routing? Because the default is localhost/class/function/data/ and your url doesn't quite correspond to it.
    – Wold
    Commented Oct 6, 2015 at 23:04
  • Yes, I removed index.php using .htaccess and routed my admin application and public application by declaring route config in route.php Commented Oct 6, 2015 at 23:35
  • 1
    Can you include the relevant routing information? That would help answer the question.
    – Wold
    Commented Oct 7, 2015 at 0:31

1 Answer 1

0

Try this within your otherpages function:

$data['somedata'] = $somedata; <br/>
$this->load->view('admin/second_view',$data);
1
  • My code is $this->render('admin/second_view',$somedata);<br/> actually i am having a MY_Controller inside application/core, which is rendering template for me loading master_header and master_footer. I am embedding the link, I have created my application according to that only.<br/>{link}(avenir.ro/create-cms-using-codeigniter-3) Commented Oct 7, 2015 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.