Facebook
From Soft Terrapin, 5 Years ago, written in Perl.
">

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 33

from

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 33

- view diff
Embed
Download Paste or View Raw
Hits: 271
  1. ####_form.html.ep
  2.  
  3. #Under code I don't know to move to Controller
  4. % my $categories = Mojo::Collection->new(['*' => 0]);
  5. % my $cats = $self->db->resultset('Category');
  6. % while (my $cat = $cats->next) {
  7. %  my @attr;
  8. %  push @attr, selected => 'selected' if $cat->id eq $category->id;
  9. %  push @{$categories}, [$cat->name, $cat->id, @attr];
  10. % }
  11.  
  12. #Under code must automatically select 'saved item at created or last change'
  13. <td>
  14.   %= select_field parent_id => $categories => (class=>'input')
  15. </td>
  16.  
  17.  
  18.  
  19. ####edit.html.ep
  20.  
  21. % layout 'admin', title => 'Jizzy.eu: Edycja Kategorii';
  22. % my $category = $self->db->resultset('Category')->find($self->stash('id'));
  23.  
  24. <h2>Category Edit [<%= $category->id %>]</h2>
  25.  
  26. %= form_for 'update_category' => (method => 'POST') => begin
  27.   %= include '/categories/_form', category => $category
  28.  
  29.         <nav class="is-flex">
  30.         %= link_to "Back" => "/categories", class => 'button', style=>"flex:1"
  31.         %= submit_button 'Update', class => 'button is-primary', style=>"flex:1"
  32.         </nav>
  33. % end

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Gruff Parakeet perl 5 Years ago.
captcha