Pregunta

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'));
?>
¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top