table->set_heading not doing anything |
I'm trying to use the table library and it looks very promising, however, I cant seem to modify the template. It looks simple enough. Too simple actually. I can't see anything to troubleshoot. It's just one line of code:
Code: $this->table->set_template(array('table_open' => '<table class="table table-hover table-condensed">')); (12-12-2015, 09:55 PM)DSMatichuk Wrote: I'm trying to use the table library and it looks very promising, however, I cant seem to modify the template. It looks simple enough. Too simple actually. I can't see anything to troubleshoot. It's just one line of code: You should be setting the template like this: PHP Code: $template = array( What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Does anyone else have a suggestion? I am setting the $template correctly as far as I can tell and it is not making a difference. How do I troubleshoot this?
Which CI version are you using?
What do you mean exactly by "makes no difference"?
(12-17-2015, 03:52 AM)Narf Wrote: Which CI version are you using? I downloaded the latest version from the website just a few days ago but it is possible that I am using the version I got from the online course I am taking. I do not know how to verify the version I am using. I am quite new to PHP so I am willing to be schooled on this but every course I have taken has told me that what I posted and what was suggested to me are identical, there is no difference. What I wrote in my question: $this->table->set_template(array('a' => 'b')); Is identical to the recommendation I received: $template = array('a' => 'b'); $this->table->set_template($template); If there is a difference between those two then please educate me. David
There's no difference between these two pieces of code, but that's not what I asked ... How do you determine that the set_template() call does nothing? Do you just look at visual changes in the page or its actual output?
You can var_dump(CI_VERSION); to see which one you're using.
CI v=3.0.1
I inspect the source. I have code to generate two identical tables. The first one is using the template and the second one is done manually. No matter what changes I make it to the first one, the first table does not change. When I view the page source it still shows the same attributes as if I had not set/changed them.
Well, there are no changes to the Table library since version 3.0.1 and I can't reproduce your problem, so the only conclusion I can make is that you're somehow not using it properly.
If you show the complete code, surely somebody could spot the mistake. |
Welcome Guest, Not a member yet? Register Sign In |