A
A
Anton2016-11-15 16:27:01
Yii
Anton, 2016-11-15 16:27:01

Where can I get the php rendering library?

Hello. I need a library to render views from the controller, that is, I need a magic render method in which I can pass the name of the view and parameters, is there such a one?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Timofeev, 2016-11-15
@webinar

Yes, yii2 has such a method out of the box.

public function actionMyAction(){
return $this->render('myView',['param1'=>'maparam1']);
}

I just don’t understand how you work with yii and don’t know about it?
Yes, in fact, in any MCV system, there is probably one.
I also read your signature "Programming in HTML" and it became interesting, but how is it?

L
LittleFatNinja, 2016-11-15
@LittleFatNinja

function render($view, $data) {
include($view);
}

D
dmitriy, 2016-11-15
@dmitriylanets

twig did not look?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question