I love the Tunnel Fighter (a dwarven PrC) for this aspect. You specialize in close quarters from fighting in subterrainian environs, well enough that if you back your opponent into a corner they're considered flanked. The higher the level in the PrC, the fewer walls you need (3, then 2, finally...