Answer the question
In order to leave comments, you need to log in
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
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question