Answer the question
In order to leave comments, you need to log in
How to remove attributed parameter in (Html::a) Yii2?
I can't figure out how to remove the parameter from the address bar (it's highlighted)
Here's my code:
<?= Html::a('Download', ['uploads/', $post->Invoice], ['class' => 'label label-primary']) ?>
$post = new Orders_list();
if($post->load(Yii::$app->request->post()) && $post->validate()){
$image = UploadedFile::getInstance($post, 'Invoice');
$post->Invoice = md5($image->baseName).'.'.$image->extension;
if($post->save()){
$image->saveAs('uploads/'.$post->Invoice);
Yii::$app->getSession()->setFlash('message', 'Post published successfull');
return $this->redirect(['site/table']);
}
else{
Yii::$app->getSession()->setFlash('message', 'Failed to post');
}
}
return $this->render('add', ['post' => $post]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question