problem about blade-Collection of common programming errors


  • teresko
    php arrays laravel-4 blade laravel-routing
    I need your help.I’ve just found out that the class \Illuminate\View\Environment has a protected array $sections and a method to get it getSections() but it returns an empty array.Here’s how I tried to get it:$view = View::make(‘pages’); $env = $view->getEnvironment(); $env->make(‘pages’);print($env->getSections());And the result is Array( )Where did I go wrong? Any suggestion will be appreciated.

  • bitlather
    laravel blade
    I can’t call member functions on objects that I pass to custom control structures in Laravel 4.1.23.My custom control structure:Blade::extend(function($view, $compiler){$pattern = $compiler->createMatcher(‘paginatePretty’);$code = ‘$1<?phpecho $2->getCurrentPage();?>’;return preg_replace($pattern, $code, $view); });My blade view code that instantiates paginatePretty:// $articles = Articles::orderBy(‘created_at’, ‘desc’)->paginate($per_page); @paginatePretty($articles)At compile ti

  • Antonio Carlos Ribeiro
    php laravel laravel-3 blade
    I’m new at laravel but I found something very strange.In my blade template I wrote:@if( $appModule == ‘someting’ ) Something @elseif($appModule == ‘somethingelse’)SomethingElse @else Nothing @endifWhen I run I get an error:Unhandled ExceptionMessage:Error rendering view: [layout]syntax error, unexpected ‘?’Location:…\storage\views/a5d6961979ebea7e1177c3836de35dd8 on line 41I opened ‘a5d6961979ebea7e1177c3836de35dd8’ and found this:<?php if( $appModule == ‘someting’ ) Something <?php els

  • dhpratik
    layout view run laravel blade
    i am new to laravel an trying to learn BLADE but there is a issue which is striking me. i have an index.blade.php@layout(‘master’)and i also have amaster.blade.php <!doctype html> <html lang=”en”> <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″> <title>Laravel: A Framework For Web Artisans</title> <meta name=”viewport” content=”width=device-width”></head> <body> hi from body </body> <

  • Klaitos
    php view laravel blade
    my laravel view structure is like this:/views/layouts/default.blade.phpcontaining <html> @yield(‘header’) <body>@yield(‘navigation’)@yield(‘content’)@yield(‘footer’) </body>following by/views/partials/footer.blade.php /views/partials/header.blade.php /views/partials/navigation.blade.phpIn my header view i have a var $title I’m trying to set it dynamically trought the controller on the home page.so in my view located in /pages/index.blade.php I got this @layout(‘layouts.defa

  • Josh
    php laravel laravel-4 fluent blade
    I’m trying to paginate a page in my view like this:@foreach($tasks as $task){{ $task->user_id }}{{ $task->client_id }}{{ $task->description }}{{ $task->duration }}{{ link_to_route(‘clients.show’, ‘View client’, array($task->client_id), array(‘class’ => ‘btn btn-primary’)) }} @endforeach{{ $tasks->links() }}Using the following query in my controller:$tasks = DB::table(‘tasks’)->join(‘users’, ‘tasks.user_id’, ‘=’, ‘users.id’)->join(‘clients’, ‘tasks.client_id’, ‘=’, ‘cli

Web site is in building