Welcome Guest, Not a member yet? Register   Sign In
Pagination configuration bug or incorrect documentation?
#1

[eluser]sparky672[/eluser]
At the bottom of this page: http://ellislab.com/codeigniter/user-gui...ation.html

Quote:If you want to add a class attribute to every link rendered by the pagination class, you can set the config "anchor_class" equal to the classname you want.

So I set the config option to the class name as instructed:

Code:
$config['anchor_class'] = 'page';

However, the rendered code was not at all as expected:

Code:
<a pagehref="/controller/2">2</a>

Either the wording in the documentation is completely wrong, or there's a bug someplace.

Alternatively, this is ugly:

Code:
$config['anchor_class'] = 'class="page"';

And yet it's still not quite correct:

Code:
<a class="page"href="/controller/2">2</a>

Notice there is a space missing between the 'class' and 'href' attributes.

This is the only way it gives the proper HTML:

Code:
$config['anchor_class'] = 'class="page" ';

And that's really nothing like what's described in the docs: "set the config 'anchor_class' equal to the classname"

Thank-you!

BTW: Perhaps this forum's anti-spam routines should be tweaked to allow posting of URL's that contain "ellislab dot com".

--------

EDIT:

I'm now convinced this is a bug.

The above problem only occurs when the configuration is declared dynamically within my Controller function and then set with `initialize($config)`.

I accidentally discovered that when a `pagination.php` config file is used instead, then it works exactly as described in the documentation.


Messages In This Thread
Pagination configuration bug or incorrect documentation? - by El Forum - 04-25-2013, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB