문제

I'm using Laravel, and it complains about $header inside the Form::text being a illegal string offset, how do I fix this? It doesn't complain if I go straight into the page, but if I submit a form with get method going into the page. I searched around and maybe it thinks $header is an array?

<?php 
        $header = null;
        if(isset($_GET["header"])) {
            $header = $_GET["header"];
        }

        echo Form::text('header', $header, array('class'=>'form-control', 'placeholder'=>'Tittel'));
?>
도움이 되었습니까?

해결책

Laravel clears the $_GET array. You need to use Input::has('header') and Input::get('header') instead.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top