mosbth / Anax-MVC

Anax as a PHP based and MVC inspired framwork
MIT License
8 stars 31 forks source link

A possibility to add a class to the li-element #5

Closed foikila closed 9 years ago

foikila commented 10 years ago

A small change that makes it possible to change the class on the li-element

mosbth commented 10 years ago

Hmm, needs to investigate what was changed in this commit.

mosbth commented 10 years ago

Hmmm,

vilka rader ändrade du egentligen?

Får ingen ledtråd av GitHUb: https://github.com/cjonqtan/Anax-MVC/commit/6336df06395928d540423dd90b0d8ff24949ce6f

Vänligen, Mikael

On 18 May 2014 03:25, Jonatan Karlsson notifications@github.com wrote:

A small change that makes it possible to change the class on the li-element

You can merge this Pull Request by running

git pull https://github.com/cjonqtan/Anax-MVC patch-2

Or view, comment on, or merge it at:

https://github.com/mosbth/Anax-MVC/pull/5 Commit Summary

  • A possibility to add a class to the li-element

File Changes

  • M src/Navigation/CNavbar.phphttps://github.com/mosbth/Anax-MVC/pull/5/files#diff-0(163)

Patch Links:

— Reply to this email directly or view it on GitHubhttps://github.com/mosbth/Anax-MVC/pull/5 .

foikila commented 10 years ago

Vet inte varför github visa att jag hade ändrat hela classen. Ändrade bara 2 rader det är rad 62: $class = isset($item['class']) && !is_null($item['class']) ? " class='{$item['class']}'" : null; rad 65: $html .= "\n<li{$selected} {$class}><a href='{$url}' title='{$item['title']}'>{$item['text']}</a>{$submenu}</li>\n";

mosbth commented 9 years ago

I fixed it. But had to rewrite the function partly. Sorry, could not merge it.

I also reformated my code to use correct tabsize and code formatting with PSR. Working example in (but code written as a pure function): http://dbwebb.se/coachen/skapa-en-dynamisk-navbar-meny-med-undermeny-via-php

foikila commented 9 years ago

Okej :+1: