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

  • Home
  • SEARCH
  • 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 8415941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:35:43+00:00 2026-06-10T01:35:43+00:00

I am fairly new to Yii and I have a small problem, but cannot

  • 0

I am fairly new to Yii and I have a small problem, but cannot figure it out. The problem is that when i call in Yii in one of my models (active records) $this->attributes = ‘something’; I get error “Property “SiteController.attributes” is not defined.”

I have this in controller:

public function actionIndex()
{
    // Create new clients active record
    $client = new Clients;

    // Check if user send some request
    if (isSet($_POST)){
        switch($_POST["action"]){
            case 'newClient':
                $registered = $client::addClient($_POST);
        }
    }

    // render the view
    $this->render('landing',array(
        // Objects
        'client' => $client,
        // Variables
        'registered' => $registered,
    ));

    return true;
}

and this in the model:

public function addClient($data){
    // Set data
    $this->attributes = $data["Clients"];
    $this->password = self::generatePassword(6);

    // Proceed
    $this->setScenario('insert');

    return true;
}

The functions are not complete of course but this is where i get the error. What is it exactly I’m doing wrong? Thank you

  • 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-06-10T01:35:45+00:00Added an answer on June 10, 2026 at 1:35 am

    You are calling the function as static method.

    $registered = $client::addClient($_POST);

    should be

    $registered = $client->addClient($_POST);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to php and mysql but I have created a small
Fairly new to Jquery here.... but one thing I have been told and being
I am fairly new to Emacs and I have been trying to figure out
I'm fairly new to ActiveRecord associations. I'm sketching out an application that tracks who
fairly new Android developer here. I've come across a strange problem that I'm not
Brief: I'm fairly new to databases and currently have one with two tables for
Being fairly new to objective-c and developing for ios I'm trying to figure out
Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
Fairly new to wpf, using the galasoft mvvm templates. I have two relaycommands that
I fairly new to JQuery and perhaps trying to achieve something that might be

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.