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 7003963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:08:14+00:00 2026-05-27T21:08:14+00:00

I am trying to include form on product page using renderPartial but it gives

  • 0

I am trying to include form on product page using renderPartial but it gives error

Fatal error: Call to a member function getErrors() on a non-object in /Applications/MAMP/htdocs/yii/framework/web/helpers/CHtml.php on line 1605

i am using below code…

in product page

// product detail goes here, use below form to make an inquiry about this product
<?php $this->renderPartial('inquiry'); ?>

and in inquiry page page

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'query-form',
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
    ),
)); ?>


    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'name'); ?>
        <?php echo $form->textField($model,'name'); ?>
        <?php echo $form->error($model,'name'); ?>
    </div>
  • 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-27T21:08:15+00:00Added an answer on May 27, 2026 at 9:08 pm

    There is a variable called $model in your view, but in your controller’s renderPartial() call, you are not passing $model into your view. So the view is looking for a variable called $model, but it does not exist.

    You need to generate a new model in your controller, then pass it into the view, as follows:

    $model = new Product(); //use whatever class you created for the model in place of 'Product' here
    
    $this->renderPartial('inquiry', array('model'=>$model));
    

    The 'model'=>$model tells Yii to pass the variable $model into the view, and the 'model' represents the name you use to access that variable from within the view. So if you write something like:

    $this->renderPartial('inquiry', array('product'=>$model));
    

    Then in the view, you would access the variable by typing $product instead of $model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to include a vCard export function in an existing page full of
I'm trying submit some form using ajax //include jquery-1.4.2.min.js var submitForm = document.createElement(FORM); ...
I'm trying to include an image in an email, which is being sent using
I am trying to include the Zend_Service_Amazon_S3 file by using require_once 'Zend/Service/Amazon/S3.php'; I have
I am trying to include a Drupal form element in a table I am
I'm trying to include in my Windows Form App a way that when user
I'm trying to return rows in Open XML form from a table value function
I'm trying to include some CSS and JS files into the change form of
I am trying to design a user registration form using code igniter 2.1.0. I
Trying to include ThickBox (from http://jquery.com/demo/thickbox/ ) in an ASP.NET application. Visual Studio is

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.