A
A
asferot2018-11-19 14:17:12
Yii
asferot, 2018-11-19 14:17:12

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) 5bf29b55b3876559878967.png
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

1 answer(s)
A
Arman, 2018-11-19
@asferot

?

<?= Html::a('Download', '/uploads/'. $post->Invoice, ['class' => 'label label-primary']) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question