I have a partial view called head and I render this partial before index view and i got client information from model and then i want to pass this client model to head partial but i can not. this is my code :
class IndexController extends ControllerBase
{
public function initialize()
{
$this->tag->setTitle($this->lang('index')->_('title'));
$this->view->setTemplateAfter('header');
$this->view->setTemplateBefore('footer');
}
public function indexAction()
{
$this->view->t = $this->lang('index');
$this->view->client = $this->getClient();
}
this is my base controller
class ControllerBase extends Controller
{
public function getClient()
{
$auth = $this->session->get('auth');
return Client::findFirst([
"client_id = :client_id:",
'bind' => [
'client_number' => $auth['client_id']
]
]);
}
how can pass this client model to head partial?
{{ partial('<FILE_HERE>', ['test':true] ) }}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.