Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]breadcrumbs
eminiasty
post 31.10.2017, 16:57:25
Post #1





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 11.09.2015

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


Witam. Korzystam z rozwiązania zawartego na stronie:
https://github.com/nobuti/Codeigniter-breadcrumbs
Mam ścieżkę
http://localhost:8080/projekt/backend/modu...42/modules/show
i za nic nie rozumię skąd po wywołaniu ścieżki tj:
  1.  
  2. $this->breadcrumbs->unshift('Home', '/');
  3. echo $this->breadcrumbs->show();

dostaje:
Home / AS / modules / 342

powinno być
Home / backend / modules / 342

Skąd się bierze to AS?

sposób jaki wymyśliłem by to obejśc to if likfidujący to, ale co to wgle jest?

  1. function show()
  2. {
  3. if ($this->breadcrumbs) {
  4.  
  5. // set output variable
  6. $output = $this->tag_open;
  7.  
  8. // construct output
  9. foreach ($this->breadcrumbs as $key => $crumb) {
  10. $keys = array_keys($this->breadcrumbs);
  11. if (end($keys) == $key) {
  12. $output .= $this->crumb_last_open . '' . $crumb['page'] . '' . $this->crumb_close;
  13. } else {
  14. $output .= $this->crumb_open . '<a href="' . $crumb['href'] . '">';
  15. if($crumb['page'] =='AS'){
  16. $output .= 'sss';
  17. } else { $output .= $crumb['page']; }
  18.  
  19. $output .= '</a> ' . $this->crumb_divider . $this->crumb_close;
  20. }
  21. }
  22.  
  23. // return output
  24. return $output . $this->tag_close . PHP_EOL;
  25. }
  26.  
  27. // no crumbs
  28. return '';
  29. }


Ten post edytował eminiasty 31.10.2017, 16:58:11
Go to the top of the page
+Quote Post
Pyton_000
post 31.10.2017, 18:49:24
Post #2





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

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


Samo się raczej nie dodaje.
Go to the top of the page
+Quote Post
marekgolan
post 31.10.2017, 20:01:14
Post #3





Grupa: Zarejestrowani
Postów: 6
Pomógł: 1
Dołączył: 29.10.2017

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


No raczej masz gdzieś podstronę "AS". Poszukaj.

Swoją drogą kiedyś coś tam napisałem jak tworzyć skuteczne breadcrumbs (na froncie). Może się przyda: link
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 12.06.2025 - 10:03