Yii2 error. Unknown Property - Yii base Unknownpropertyexception

Asked

Viewed 113 times

1

Good night,

I haven’t been able to use Yii software for several months due to the following error:

Unknown Property - Yii base Unknownpropertyexception Getting Unknown Property: app models youSearch::E 1. in C: xampp htdocs yii2basic vendor yiisoft yii2 base Component.php at line 147

138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 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);
}

/**
 * Sets the value of a component property.
 * This method will check in the following order and act accordingly:
 *
 *  - a property defined by a setter: set the property value
 *  - an event in the format of "on xyz": attach the handler to the event "xyz"
 *  - a behavior in the format of "as xyz": attach the behavior named as "xyz"

2. in C: xampp htdocs yii2basic vendor yiisoft yii2 db Basectiverecord.php at line 286 - Yii base Component::__get('E') 3. in C: xampp htdocs yii2basic models youSearch.php at line 66 - Yii db Basectiverecord::__get('E')

60 61 62 63 64 65 66 67 68 69 70 // grid Filtering conditions $query->andFilterWhere([ 'id' => $this->id, ]);

    $query->andFilterWhere(['like', 'Nome', $this->Nome])
        ->andFilterWhere(['like', 'E-mail', $this->E-mail]);

    return $dataProvider;
}

} 4. in C: xampp htdocs yii2basic controllers Youcontroller.php at line 39 - app models youSearch::search(['r' => 'you/index'])

33 34 35 36 37 38 39 40 41 42 43 44 45 * Lists all you models. * @Return Mixed */ public Function actionIndex() { $searchModel = new youSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

    return $this->render('index', [
        'searchModel' => $searchModel,
        'dataProvider' => $dataProvider,
    ]);
}

5.

app controllers Youcontroller::actionIndex() 6. in C: xampp htdocs yii2basic vendor yiisoft yii2 base Inlineaction.php at line 57 - call_user_func_array([app controllers Youcontroller, 'actionIndex'], [])

51 52 53 54 55 56 57 58 59 $args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', METHOD); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; }

    return call_user_func_array([$this->controller, $this->actionMethod], $args);
}

} 7. in C: xampp htdocs yii2basic vendor yiisoft yii2 base Controller.php at line 156 - Yii base Inlineaction::runWithParams(['r' => 'you/index'])

150 151 152 153 154 155 156 157 158 159 160 161 162 }

    $result = null;

    if ($runAction && $this->beforeAction($action)) {
        // run the action
        $result = $action->runWithParams($params);

        $result = $this->afterAction($action, $result);

        // call afterAction on modules
        foreach ($modules as $module) {
            /* @var $module Module */

8. in C: xampp htdocs yii2basic vendor yiisoft yii2 base Module.php at line 523 - Yii base Controller::runAction('index', ['r' => 'you/index'])

517 518 519 520 521 522 523 524 525 526 527 528 529 $Parts = $this->createController($route); if (is_array($Parts)) { /* @var $controller Controller */ list($controller, $actionID) = $Parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; }

        return $result;
    }

9. in C: xampp htdocs yii2basic vendor yiisoft yii2 web Application.php at line 102 - Yii base Module::runAction('you/index', ['r' => 'you/index'])

96 97 98 99 100 101 102 103 104 105 106 107 108 $params = $this->catchall; unset($params[0]); } Try { Yii::trace("Route requested: '$route'", METHOD); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { Return $result; } Else { $Response = $this->getresponse(); if ($result !== null) { $sponse->data = $result; 10. in C: xampp htdocs yii2basic vendor yiisoft yii2 base Application.php at line 380 - Yii web Application::handleRequest(Yii web Request)

374 375 376 377 378 379 380 381 382 383 384 385 386 Try {

        $this->state = self::STATE_BEFORE_REQUEST;
        $this->trigger(self::EVENT_BEFORE_REQUEST);

        $this->state = self::STATE_HANDLING_REQUEST;
        $response = $this->handleRequest($this->getRequest());

        $this->state = self::STATE_AFTER_REQUEST;
        $this->trigger(self::EVENT_AFTER_REQUEST);

        $this->state = self::STATE_SENDING_RESPONSE;
        $response->send();

11. in C: xampp htdocs yii2basic web index.php at line 12 - Yii base Application::run()

6 7 8 9 10 11 12

require(DIR . '/../vendor/autoload.php'); require(DIR . '/../vendor/yiisoft/yii2/Yii.php');

$config = require(DIR . '/../config/web.php');

(new Yii web Application($config))->run(); $_GET = [ 'r' => 'you/index', ];

$_COOKIE = [ '_csrf' => '3b5f68c032a757f50362118af4f7dbe99c4f8edb6c59634088c86586a0c773a5a:2:{i:0;s:5:"_csrf";i:1;s:32:"-8SgE6myM5wjc1W4Cr3fk4MlcCoJoVwk";}', ];

Can you help me?

  • Please edit this question because you are very confused. Make a Tour to learn about how this site works and mainly how to ask a question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.