LolWalid
LolWalid

Reputation: 545

Getting 404 when switching to production with yii framework

i'm using yii framework to develop, everything works fine when i was in development.

This morning I added a new route and push it to the server but i can't access it, i got a 404 page not found. I try to change access rules to make it accessible by every one but nothing change, still 404. I m trying to access to update method via this url: index.php?r=adminuser/update&id=5

Here is the code of the controller:

class AdminUserController extends Controller {

  public function filters()
  {
    return array(
        'accessControl', // perform access control for CRUD operations
    );
  }

  public function accessRules()
  {
    return array(
        array('allow', 
            'actions' => array('index', 'create', 'update'),
            'users'   => array('@'),
        ),
        array('allow', 
            'actions' => array('admin', 'delete'),
            'roles'   => array('admin'),
        ),
        array('deny', // deny all users
            'users' => array('*'),
        ),
    );
  }
  public function actionUpdate($id)
  {
   $model=$this->loadModel($id);

   if(isset($_POST['AdminUser']))
     $model->save($_POST['AdminUser'])
   $this->render('update',array(
        'model'=>$model,
    ));
  }
}

Thanks you for those who can help me.

Upvotes: 2

Views: 144

Answers (1)

hamed
hamed

Reputation: 8033

Your url should be like index.php?r=adminUser/update&id=5

Upvotes: 2

Related Questions