new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001',
transports: ['websocket', 'polling', 'flashsocket'],
auth: {
headers: {
Authorization: `Bearer ${token}`
}
}
});
$server = IoServer::factory(
new HttpServer(
new WsServer(
new $server
)
),
$port
);
$server->run();
<div ng-repeat="(key, val) in datas.options.sex">
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="null"
ng-model="$parent.filter.sex[key]"
/> {{val}}
</label>
</div>
$stateProvider
.state('root', {
url: '/{lang:ru|en|de}',
abstract: true,
template: '<div ui-view></div>'
})
.state('root.home', {
url: '/',
views: {
'': {
templateUrl: '/frontend/app/template/index.php',
controller: 'MainController'
}
}
})
.state('root.about', {
url: '/about/',
views: {
'': {
templateUrl: '/frontend/app/template/about.php',
controller: 'AboutController'
}
}
});
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>