What is the most elegant way to print breadcrumbs on a website? -
i've been thinking long time already. best, or elegant, way of creating breadcrumbs? one way have method called controllers. this: function showusers() { $this->breadcrumbs->add('users', url::route('admin.users')); // ... } i don't way, though, because i'd separate breadcrumb-logic controllers. also, if i'd e.g. have admin panel -item many pages inside controller, i'd need either define in constructor or in every controller method. another way utilize named routes, breaking them segments. requires routes sensibly named , structured in way. here's pseudocode: if($segment[0] == 'admin') { $breadcrumbs->add('admin panel', url::route('admin'); if($segment[1] == 'users') { $breadcrumbs->add('users', url::route('admin.users'); } elseif($segment[1] == 'foo') { $breadcrumbs->add(...); } } one issue approach it's hard "da...