Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Using CSS in Laravel views.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 337
    Comment on it

    CSS plays an important role in every project. In Laravel 4.x we will define our css in:

    public/css/custom.css
    

    Here In above path we will define our css in laravel 4.x

    To call a view from controller we will use the code as follow:

    Example:

    return View::make('karmaMeetings',array('pageTitle' => 'Meeting | KarmaCircles','CurrentUser' => $CurrentUser,'GiverInMeeting'=>$GiverInMeeting,
            'ReceiverInMeeting'=>$ReceiverInMeeting,'countRec'=>'0','countArc'=>'0','countSent'=>'0', 'totalReceivedRequest'=>$totalReceivedRequest));
        }
    

    Here We can see View::make we will call the view and karmaMeetings is our view blade file.

    We will define our css in the layout which we will make in views folder.

    Path of Layout:

    app/views/common/site.blade.php
    

    And We will define css like below

        {{ HTML::style('css/font.css') }}
        {{ HTML::style('css/bootstrap.css') }}
        {{ HTML::style('css/custom.css') }}
        {{ HTML::style('css/media.css') }}
        {{ HTML::style('css/bootstrap-datetimepicker.min.css') }}
    

    By this way we will define css and call a view from controller.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: