N
N
Nikolai Gromov2018-05-17 10:32:06
Zend Framework
Nikolai Gromov, 2018-05-17 10:32:06

How to change a string correctly?

Hello.
I have a simple one, but I'm already confused.
Previously, in my view I had such an image output

<img src="<?= $this->url('application', ['action'=>'file'], 
                                ['query'=>['name'=>$foto], 'thumbnail'=>true]); ?>" alt="" class="d-block w-100" data-toggle="modal" data-target="#exampleModal">

now I'm moving this to the view helper and I need to convert this line to php.
Should be something like this
$result .= '<img src="'.('application', ['action'=>'file'],
                                ['query'=>['name'=>$escapeHtml($foto)],  'thumbnail'=>true]).'" alt="" class="d-block w-100" data-toggle="modal" data-target="#exampleModal">';

There is no $this->url() method in the helper, if at the same time tell me how to get it there, I would be very grateful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-05-17
@dimkabelkov

it's not very clear what you want, you would at least write the libraries and frameworks that you use

M
Maxim Timofeev, 2018-05-17
@webinar

You need to pass either a ready-made url to the widget (view helper)
Example:
https://olegkrivtsov.github.io/using-zend-framewor...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question