By taking into consideration the following code snipped:
if('<?= Yii::app()->controller->action->id?>' == 'create'){
$("#Event_name").focusout(function(){
$.ajax({
success: function(html)
{
type: 'get',
url: '<?php echo $this->createUrl('related'); ?>'
This works. But…
It’s this a proper way of doing it ? I would prefer to have php on one side, and javascript on the other side, does it makes sense?
Can someone please provide me an example about how would something like this look like when properly done?
I am not well experienced with the framework you are using but it is better if you pass the variables from the controller to your view:
Controller:
View: