A
A
Alexander Ivanov2018-05-21 20:02:08
Yii
Alexander Ivanov, 2018-05-21 20:02:08

What is missing in action?

I am migrating a site from a local Windows server (OpenServer) to MacOs (MAMP). Some Actions began to give the error "syntax error, unexpected end of file".
An example of one of these actions:

public function actionProjects()
    {
    $status = Yii::$app->user->identity->status; 
    if($status == 'admin'){
            if(Yii::$app->request->get()){
              $name =$_GET['name_project'];
              $url = $_GET['url_project'];
    $projects = projects::find()->where(['name' => $name,'url' => $url]) -> one();
    $projects -> delete();
    return Yii::$app->response->redirect(Url::to($baseUrl.'/site/projects'));
                          }
    }	
        $projects = projects::find()->all();
        return $this->render('Projects',[
            'projects' => $projects,
            ]);
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-05-21
@webinar

projects::
This is apparently ,
but here it is
apparently the other way around
$projects -> delete();- why are there spaces?
But the most important thing is
if(Yii::$app->request->get()){not closed

M
Mysterion, 2018-05-21
@Mysterion

"syntax error, unexpected end of file".

This is a PARSE exception and it occurs when you try to feed a script with errors to the interpreter.
These are quotes, brackets, colons, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question