Unable to resolve the request “user” in yii1.1





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am new with PHP and trying to create yii App and I have to use yii1.1



I am following https://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app



I generated Gii and after I got to the last step which is "Accessing CRUD Pages", I faced this error:




Unable to resolve the request "user"




I checked the User file and its name.
While the database is succesfully connected.



And here is the code of User file where its directory is : testdrive1/protected/models/User.php



<?php
/**
* This is the model class for table "tbl_user".
*
* The followings are the available columns in table 'tbl_user':
* @property integer $id
* @property string $username
* @property string $password
* @property string $email
* @property string $image
* @property double $lat
* @property double $lng
*/
class User extends CActiveRecord
{
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'tbl_user';
}

/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('username, password, email', 'required'),
array('lat, lng', 'numerical'),
array('username, password, email', 'length', 'max'=>128),
array('image', 'length', 'max'=>100),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('id, username, password, email, image, lat, lng', 'safe', 'on'=>'search'),
);
}

/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
);
}

/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'ID',
'username' => 'Username',
'password' => 'Password',
'email' => 'Email',
'image' => 'Image',
'lat' => 'Lat',
'lng' => 'Lng',
);
}

/**
* Retrieves a list of models based on the current search/filter conditions.
*
* Typical usecase:
* - Initialize the model fields with values from filter form.
* - Execute this method to get CActiveDataProvider instance which will filter
* models according to data in model fields.
* - Pass data provider to CGridView, CListView or any similar widget.
*
* @return CActiveDataProvider the data provider that can return the models
* based on the search/filter conditions.
*/
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.

$criteria=new CDbCriteria;

$criteria->compare('id',$this->id);
$criteria->compare('username',$this->username,true);
$criteria->compare('password',$this->password,true);
$criteria->compare('email',$this->email,true);
$criteria->compare('image',$this->image,true);
$criteria->compare('lat',$this->lat);
$criteria->compare('lng',$this->lng);

return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}

/**
* Returns the static model of the specified AR class.
* Please note that you should have this exact method in all your CActiveRecord descendants!
* @param string $className active record class name.
* @return User the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}









share|improve this question































    0















    I am new with PHP and trying to create yii App and I have to use yii1.1



    I am following https://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app



    I generated Gii and after I got to the last step which is "Accessing CRUD Pages", I faced this error:




    Unable to resolve the request "user"




    I checked the User file and its name.
    While the database is succesfully connected.



    And here is the code of User file where its directory is : testdrive1/protected/models/User.php



    <?php
    /**
    * This is the model class for table "tbl_user".
    *
    * The followings are the available columns in table 'tbl_user':
    * @property integer $id
    * @property string $username
    * @property string $password
    * @property string $email
    * @property string $image
    * @property double $lat
    * @property double $lng
    */
    class User extends CActiveRecord
    {
    /**
    * @return string the associated database table name
    */
    public function tableName()
    {
    return 'tbl_user';
    }

    /**
    * @return array validation rules for model attributes.
    */
    public function rules()
    {
    // NOTE: you should only define rules for those attributes that
    // will receive user inputs.
    return array(
    array('username, password, email', 'required'),
    array('lat, lng', 'numerical'),
    array('username, password, email', 'length', 'max'=>128),
    array('image', 'length', 'max'=>100),
    // The following rule is used by search().
    // @todo Please remove those attributes that should not be searched.
    array('id, username, password, email, image, lat, lng', 'safe', 'on'=>'search'),
    );
    }

    /**
    * @return array relational rules.
    */
    public function relations()
    {
    // NOTE: you may need to adjust the relation name and the related
    // class name for the relations automatically generated below.
    return array(
    );
    }

    /**
    * @return array customized attribute labels (name=>label)
    */
    public function attributeLabels()
    {
    return array(
    'id' => 'ID',
    'username' => 'Username',
    'password' => 'Password',
    'email' => 'Email',
    'image' => 'Image',
    'lat' => 'Lat',
    'lng' => 'Lng',
    );
    }

    /**
    * Retrieves a list of models based on the current search/filter conditions.
    *
    * Typical usecase:
    * - Initialize the model fields with values from filter form.
    * - Execute this method to get CActiveDataProvider instance which will filter
    * models according to data in model fields.
    * - Pass data provider to CGridView, CListView or any similar widget.
    *
    * @return CActiveDataProvider the data provider that can return the models
    * based on the search/filter conditions.
    */
    public function search()
    {
    // @todo Please modify the following code to remove attributes that should not be searched.

    $criteria=new CDbCriteria;

    $criteria->compare('id',$this->id);
    $criteria->compare('username',$this->username,true);
    $criteria->compare('password',$this->password,true);
    $criteria->compare('email',$this->email,true);
    $criteria->compare('image',$this->image,true);
    $criteria->compare('lat',$this->lat);
    $criteria->compare('lng',$this->lng);

    return new CActiveDataProvider($this, array(
    'criteria'=>$criteria,
    ));
    }

    /**
    * Returns the static model of the specified AR class.
    * Please note that you should have this exact method in all your CActiveRecord descendants!
    * @param string $className active record class name.
    * @return User the static model class
    */
    public static function model($className=__CLASS__)
    {
    return parent::model($className);
    }
    }









    share|improve this question



























      0












      0








      0








      I am new with PHP and trying to create yii App and I have to use yii1.1



      I am following https://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app



      I generated Gii and after I got to the last step which is "Accessing CRUD Pages", I faced this error:




      Unable to resolve the request "user"




      I checked the User file and its name.
      While the database is succesfully connected.



      And here is the code of User file where its directory is : testdrive1/protected/models/User.php



      <?php
      /**
      * This is the model class for table "tbl_user".
      *
      * The followings are the available columns in table 'tbl_user':
      * @property integer $id
      * @property string $username
      * @property string $password
      * @property string $email
      * @property string $image
      * @property double $lat
      * @property double $lng
      */
      class User extends CActiveRecord
      {
      /**
      * @return string the associated database table name
      */
      public function tableName()
      {
      return 'tbl_user';
      }

      /**
      * @return array validation rules for model attributes.
      */
      public function rules()
      {
      // NOTE: you should only define rules for those attributes that
      // will receive user inputs.
      return array(
      array('username, password, email', 'required'),
      array('lat, lng', 'numerical'),
      array('username, password, email', 'length', 'max'=>128),
      array('image', 'length', 'max'=>100),
      // The following rule is used by search().
      // @todo Please remove those attributes that should not be searched.
      array('id, username, password, email, image, lat, lng', 'safe', 'on'=>'search'),
      );
      }

      /**
      * @return array relational rules.
      */
      public function relations()
      {
      // NOTE: you may need to adjust the relation name and the related
      // class name for the relations automatically generated below.
      return array(
      );
      }

      /**
      * @return array customized attribute labels (name=>label)
      */
      public function attributeLabels()
      {
      return array(
      'id' => 'ID',
      'username' => 'Username',
      'password' => 'Password',
      'email' => 'Email',
      'image' => 'Image',
      'lat' => 'Lat',
      'lng' => 'Lng',
      );
      }

      /**
      * Retrieves a list of models based on the current search/filter conditions.
      *
      * Typical usecase:
      * - Initialize the model fields with values from filter form.
      * - Execute this method to get CActiveDataProvider instance which will filter
      * models according to data in model fields.
      * - Pass data provider to CGridView, CListView or any similar widget.
      *
      * @return CActiveDataProvider the data provider that can return the models
      * based on the search/filter conditions.
      */
      public function search()
      {
      // @todo Please modify the following code to remove attributes that should not be searched.

      $criteria=new CDbCriteria;

      $criteria->compare('id',$this->id);
      $criteria->compare('username',$this->username,true);
      $criteria->compare('password',$this->password,true);
      $criteria->compare('email',$this->email,true);
      $criteria->compare('image',$this->image,true);
      $criteria->compare('lat',$this->lat);
      $criteria->compare('lng',$this->lng);

      return new CActiveDataProvider($this, array(
      'criteria'=>$criteria,
      ));
      }

      /**
      * Returns the static model of the specified AR class.
      * Please note that you should have this exact method in all your CActiveRecord descendants!
      * @param string $className active record class name.
      * @return User the static model class
      */
      public static function model($className=__CLASS__)
      {
      return parent::model($className);
      }
      }









      share|improve this question
















      I am new with PHP and trying to create yii App and I have to use yii1.1



      I am following https://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app



      I generated Gii and after I got to the last step which is "Accessing CRUD Pages", I faced this error:




      Unable to resolve the request "user"




      I checked the User file and its name.
      While the database is succesfully connected.



      And here is the code of User file where its directory is : testdrive1/protected/models/User.php



      <?php
      /**
      * This is the model class for table "tbl_user".
      *
      * The followings are the available columns in table 'tbl_user':
      * @property integer $id
      * @property string $username
      * @property string $password
      * @property string $email
      * @property string $image
      * @property double $lat
      * @property double $lng
      */
      class User extends CActiveRecord
      {
      /**
      * @return string the associated database table name
      */
      public function tableName()
      {
      return 'tbl_user';
      }

      /**
      * @return array validation rules for model attributes.
      */
      public function rules()
      {
      // NOTE: you should only define rules for those attributes that
      // will receive user inputs.
      return array(
      array('username, password, email', 'required'),
      array('lat, lng', 'numerical'),
      array('username, password, email', 'length', 'max'=>128),
      array('image', 'length', 'max'=>100),
      // The following rule is used by search().
      // @todo Please remove those attributes that should not be searched.
      array('id, username, password, email, image, lat, lng', 'safe', 'on'=>'search'),
      );
      }

      /**
      * @return array relational rules.
      */
      public function relations()
      {
      // NOTE: you may need to adjust the relation name and the related
      // class name for the relations automatically generated below.
      return array(
      );
      }

      /**
      * @return array customized attribute labels (name=>label)
      */
      public function attributeLabels()
      {
      return array(
      'id' => 'ID',
      'username' => 'Username',
      'password' => 'Password',
      'email' => 'Email',
      'image' => 'Image',
      'lat' => 'Lat',
      'lng' => 'Lng',
      );
      }

      /**
      * Retrieves a list of models based on the current search/filter conditions.
      *
      * Typical usecase:
      * - Initialize the model fields with values from filter form.
      * - Execute this method to get CActiveDataProvider instance which will filter
      * models according to data in model fields.
      * - Pass data provider to CGridView, CListView or any similar widget.
      *
      * @return CActiveDataProvider the data provider that can return the models
      * based on the search/filter conditions.
      */
      public function search()
      {
      // @todo Please modify the following code to remove attributes that should not be searched.

      $criteria=new CDbCriteria;

      $criteria->compare('id',$this->id);
      $criteria->compare('username',$this->username,true);
      $criteria->compare('password',$this->password,true);
      $criteria->compare('email',$this->email,true);
      $criteria->compare('image',$this->image,true);
      $criteria->compare('lat',$this->lat);
      $criteria->compare('lng',$this->lng);

      return new CActiveDataProvider($this, array(
      'criteria'=>$criteria,
      ));
      }

      /**
      * Returns the static model of the specified AR class.
      * Please note that you should have this exact method in all your CActiveRecord descendants!
      * @param string $className active record class name.
      * @return User the static model class
      */
      public static function model($className=__CLASS__)
      {
      return parent::model($className);
      }
      }






      php gii






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 '18 at 6:51









      Robert

      2,27562637




      2,27562637










      asked Nov 25 '18 at 1:46









      Zoulfa AL BawabZoulfa AL Bawab

      11




      11
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463988%2funable-to-resolve-the-request-user-in-yii1-1%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463988%2funable-to-resolve-the-request-user-in-yii1-1%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Hercules Kyvelos

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud