Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inny][Laravel] Błąd..
Randallmaster
post
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


FatalErrorException in 5834626c2b58c8049ae9f7e40cbcfa7f line 0:
Method Illuminate\View\View::__toString() must not throw an exception

Niestety nic mi to nie mówi (IMG:style_emoticons/default/sad.gif)

Wiem że błąd występuje w tym miejscu:
{(IMG:style_emoticons/default/exclamation.gif) Form::open($settingsForm['formOpen']) (IMG:style_emoticons/default/exclamation.gif) } // w tej zminnej przesyłam array
{(IMG:style_emoticons/default/exclamation.gif) Form::open() (IMG:style_emoticons/default/exclamation.gif) } // jak usunę nie ma problemu :/ $settingsForm['formOpen']

Ten post edytował Randallmaster 7.08.2015, 21:05:29
Go to the top of the page
+Quote Post
memory
post
Post #2





Grupa: Zarejestrowani
Postów: 616
Pomógł: 84
Dołączył: 29.11.2006
Skąd: bełchatów

Ostrzeżenie: (0%)
-----


var_dump $settingsForm['formOpen']
Go to the top of the page
+Quote Post
Randallmaster
post
Post #3





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


zawartość nie ważne czy zrobię stringiem czy array to i tak wywala błąd. Trochę ten komunikat z błędem mało mówi...
Go to the top of the page
+Quote Post
memory
post
Post #4





Grupa: Zarejestrowani
Postów: 616
Pomógł: 84
Dołączył: 29.11.2006
Skąd: bełchatów

Ostrzeżenie: (0%)
-----


a jaka to zawartość ?
Go to the top of the page
+Quote Post
Randallmaster
post
Post #5





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


string(94) " 'method' => 'POST', 'action' => 'PagesController@update', "
albo array
Go to the top of the page
+Quote Post
Pyton_000
post
Post #6





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Form::open przyjmuje jako argument Tylko Array:
Kod
public function open(array $options = [])


Zrób tak:

Kod
{(IMG:style_emoticons/default/exclamation.gif) Form::open([$settingsForm['formOpen']]) (IMG:style_emoticons/default/exclamation.gif) }
Go to the top of the page
+Quote Post
Randallmaster
post
Post #7





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


Ciągle ten sam błąd ;/

Moja zmienna:

  1. $settingsForm = [];
  2. $settingsForm['formOpen'] = [
  3. 'method' => 'POST',
  4. 'action' => 'PagesController@update',
  5. 'class' => 'form-horizontal',
  6. 'role' => 'form'
  7. ];


Smarty:

  1. {!! Form::open([$settingsForm['formOpen']]) !!} //tak nie działa pokazuje błąd Method Illuminate\View\View::__toString() must not throw an exception
  2. //lub
  3. {!! Form::open($settingsForm['formOpen']) !!} //tak niby dodaje do formularza ponieważ formularz poprawnie się wyświetli ale zaraz za formularzem jest ten sam błąd Method Illuminate\View\View::__toString() must not throw an exception
  4.  
  5. //a jeżeli zrobie tak:
  6. {!! Form::model(['method' => 'POST', 'action' => 'PagesController@insert', 'class' => 'form-horizontal', 'role' => 'form']) !!} //wpisze wszystko z palca to bez problemu strona się wczytuje
  7.  


Ogólnie pokazywanie błędów w Laravel trochę mnie denerwuje bo nie pisze dokładnie w czym jest problem tylko : Method Illuminate\View\View::__toString() must not throw an exception

Chyba że można sprawdzić w inny sposób błędy.

  1. {!! Form::model(['method' => 'POST', 'action' => 'PagesController@insert', 'class' => 'form-horizontal', 'role' => 'form']) !!}
  2. // czy też
  3. {!! Form::open(['method' => 'POST', 'action' => 'PagesController@insert', 'class' => 'form-horizontal', 'role' => 'form']) !!}
  4.  
  5. //open nie model
Go to the top of the page
+Quote Post
Daiquiri
post
Post #8





Grupa: Administratorzy
Postów: 1 552
Pomógł: 211
Dołączył: 7.07.2009
Skąd: NJ




Jak przekazujesz zmienną do widoku?
Go to the top of the page
+Quote Post
Randallmaster
post
Post #9





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


Problem znaleziony:

  1. //poprawna forma to
  2. {!! Form::open($settingsForm['formOpen']) !!}


Problem występował ponieważ miałem w innym tabie formularz i nie przesyłałem tam zmiennej array.

Jest jakiś sposób aby błędy pokazywało dokładniej ? bo błąd
Method Illuminate\View\View::__toString() must not throw an exception

nic nie mówi i teraz szukać po programie gdzie błąd ;/

Ten post edytował Randallmaster 8.08.2015, 08:48:59
Go to the top of the page
+Quote Post
Pyton_000
post
Post #10





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Skoro dostajesz błąd widoku to otwórz sobie skompilowany widok i tam szukaj, będziesz widział w czym jest błąd.

I zdecyduj się albo przekazujesz Array albo String

Ten post edytował Pyton_000 8.08.2015, 09:27:21
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 13:39