i'm trying to build forum in my website using Yii2 Podium. But after I installed it I can't access the
podium/home
and I got this message :
Unknown Property – yii\base\UnknownPropertyException
Getting unknown property: common\models\User::newMessagesCount
and this is the Component file
in C:\xampp\htdocs\tugasakhir\vendor\yiisoft\yii2\base\Component.php
public function __get($name)
{
$getter = 'get' . $name;
if (method_exists($this, $getter)) {
// read property, e.g. getName()
return $this->$getter();
}
// behavior property
$this->ensureBehaviors();
foreach ($this->_behaviors as $behavior) {
if ($behavior->canGetProperty($name)) {
return $behavior->$name;
}
}
if (method_exists($this, 'set' . $name)) {
throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
}
throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}
What would be the problem?
User
Model inside yourcommon/models
folder it cannot find the field name in the tableuser
you must be running a select query with count andnewMessagesCount
is an alias. is it true? – Muhammad Omer Aslam