[Error] failed to open stream: No such file or directory (YiiBase.php)

Hi! I have a simple login:

<?php $form=$this->beginWidget('CActiveForm', array(



    'clientOptions'=>array('validateOnSubmit'=>true,),)); ?>

<div class="container">

    <div class="form-signin">

        <h2 class="form-signing-heading">Login</h2>

        <label for="inputUsuario" class="sr-only">



        <?php echo $form->textField($model,'username',array('class'=>"form-control",'placeholder'=>"Usuario",'id'=>"username")); ?>

        <label for="inputPassword" class="sr-only">



        <?php echo $form->passwordField($model,'password',array('class'=>"form-control",'placeholder'=>"Password",'id'=>"password", 'name'=>"password")); ?>


        <?php echo CHtml::Button('Entrar',array("class"=>"btn btn-lg btn-primary btn-block","onclick"=>"login()")); ?>

        <?php $this->endWidget(); ;?>



The login calls a controller via AJAX:


    function login(){


        var usuario  = $('#username').val();

        var password = $('#password').val();

        if(usuario == "" || usuario == null || password == "" || password == null){

            alert('Ingrese los datos');



            var data = {'usuario':usuario, 'password':password};


                url: 'login',

                type: "POST",

                data: data,

                dataType: "html",

                cache: false,

                success: function (response){


                    if(response == 'error'){

                        alert('Error al loguear');



                        alert("do something");







I have this problem:

¿Any sugesstion?

I searched all the posible solutions but i dont have lucky.

Thanks, Regards

I solved it, the problem was i have two "echo" on the controller.

Now, my problem it’s the response is my “echo” + all the html.

Why?? :blink:

I solved it.

The problem was on the controller. You must put else, before the render.