Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4271014
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:23:04+00:00 2026-05-21T07:23:04+00:00

I am getting the following error when I try and access: domain.co.nz/admin/editpage/home/ I get

  • 0

I am getting the following error when I try and access:

domain.co.nz/admin/editpage/home/

I get the following error:

PHP Fatal error:  Call to a member function getCMSPage() on a non-object in controllers/home.php on line 22 

The issue with this is that I cannot understand why it is being passed back into the main “home” controller – which is the main controller.

All of my models are loaded by default – http://cl.ly/2U1F3a2B0s2K0i3k3g13

Ideal Situation

What I am trying to do with this is load the content into a text area on for editing and when submit is clicked I would like it to go back to the same page with a message saying content updated.

Admin Template

<li><?php echo anchor('#','Edit Pages');?>
            <?php if(is_array($cms_pages)): ?>
                    <ul>
                        <?php foreach($cms_pages as $page): ?>
                        <li><a >permalink?>"><?=$page->name?></a></li>
                        <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
                </li> 

Page Model

function updatePage($data){
        $data = array('content' => $content);
        $this ->db->where('id',$id);
        $this->db->update('pages',$data);
    } 

View:

<?php
//Setting form attributes
$formpageEdit = array('id' => 'pageEdit', 'name' => 'pageEdit');
$formInputTitle = array('id' => 'title', 'name' => 'title');
$formTextareaContent = array('id' => 'content', 'name' => 'content');
?>

<section id = "validation"><?php echo validation_errors();?></section>

<h4><?= $title ?> </h4>
<?php
echo form_open('admin/editpage/'.$page->permalink, $formpageEdit);
echo form_fieldset();
echo form_label ('Content', 'content');
echo form_textarea("content", $page['content']);
echo form_submit('submit','Submit');
echo form_fieldset_close();
echo form_close();
?> 

Controller:

function index(){
        if($this->session->userdata('logged_in')){

        }else{
            redirect('admin/home');
        }
       $page = $this->navigation_model->getCMSPage($this->uri->segment(3));
        $data['cms_pages'] = $this->navigation_model->getCMSPages();
        $data['title'] = $page->name;
        $data['content'] = $this->load->view('admin/editpage', array('page' => $page, TRUE));

        $this->load->view('admintemplate', $data);

    } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:23:05+00:00Added an answer on May 21, 2026 at 7:23 am
    // this line
    $data['content'] = $this->load->view('admin/editpage', $data);
    // needs to be
    $data['content'] = $this->load->view('admin/editpage', array('page' => $page, TRUE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following error when I try to access bins private member
I seem to be getting the following error when I try to access a
I am getting the following error when I try to access access Velocity template
Using the Facebook PHP SDK, I'm getting the following error when I try to
I'm getting the following error when I try to access a page that's supposed
I'm getting following error when I try to log onto phpMyAdmin. User * *
I am getting the following error when try to save. SQL Query: INSERT INTO
We are getting following error when we try to validate our app. This bundle
I'm getting the following error when I try to do ./app/console doctrine:migrate:diff : [Doctrine\ORM\Mapping\MappingException]
I'm getting the following error when I try to open up a connection with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.