React
- 1 ответ
- 0 вопросов
1
Вклад в тег
function renderView( $view ) {
if ( strstr($_SERVER['HTTP_ACCEPT'], 'application/json') ) {
echo json_encode( $this->Datas );
Jbase::end();
} else {
return $this->lang->getTemplate( $this->render('../../../public/frontend/app/template/' . $view, [
'datas' => $this->Datas
]));
}
}
<h1 class="page-header" ng-bind="datas.meta.title | t:Phrase"><ml:ru><?= $datas['meta']['title'] ?></ml></h1>
new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001',
transports: ['websocket', 'polling', 'flashsocket'],
auth: {
headers: {
Authorization: `Bearer ${token}`
}
}
});