Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update on View Updates
02-28-2014, 01:12 AM,
#1
Update on View Updates
OK so I won't post the code for this yet because I'm not quite happy with it, I need time to ensure that I have proper templates/classes that will balance keeping things simple but also flexible.

There's not much point to me releasing it until I've gone through most of the existing code to find output patterns, but while it does involve a lot of changes to the code structure it doesn't actually change anything in terms of output or functionality.

Some updates on the approach, to at least give an idea of where i'm heading with this:

I have implemented a class, called tableView

to display a table using the class, we'd start with any custom css classes,
which in general seems to be 'selection'.
so to use it we'd do the following:
Code:
$randomTable = new tableView
$randomTable->setClasses('table','selection');
then we'd add headers: tableView expects it as an array.
If an element is an array, it will look for specific things 'content', 'link', 'classes','span'.

Code:
$headers[] = 'Title 1';
$headers[] = 'Title 2';
$headers[] = 'Title 3';
$specialheader['content'] = 'Title 4, 2 span & link';
$specialheader['link'] = $someurl;
$specialheader['span'] = 2;
$headers[] = $specialheader;

$randomTable->setHeaders($headers);
so now the headers are ready, what about content.

Content is prepared the same way, each row is added one at a time
Code:
$newrow[] = "First cell";
$newrow[] = "Second cell";
$specialrow['content'] = '3 span cell';
$specialrow['classes'] = 'some-css-class';
$specialrow['span'] = 3;
$newrow[] = $specialrow;

$randomTable->addRow($specialrow);
Finally, we use the output by calling
Code:
$randomTable->display();

Ultimately, the class connects between the 'workhorse' code and ensures that everything will be passed in a way that the template can use easily.
And lastly, the templates are in separate files, they are basically html with placeholders for the pieces of information. Also, it makes the code a bit more understandable since you don't have to think about <tr> and <td> and all that mess. It also allows for those to even be replaced by div's or other formatting down the road.

For an idea of what it looks like in production code here's a revised AccountGroups.php

Let me know what you think, I will post more once I have the classes/templates more worked out.


Attached Files
.php   AccountGroups.php (Size: 20.16 KB / Downloads: 7)
Reply


Messages In This Thread
Update on View Updates - by serakfalcon - 02-28-2014, 01:12 AM
RE: Update on View Updates - by serakfalcon - 02-28-2014, 11:37 PM
RE: Update on View Updates - by phil - 03-01-2014, 01:53 PM
RE: Update on View Updates - by serakfalcon - 03-01-2014, 03:53 PM
RE: treating numbers as 'numbers' - by opto - 03-01-2014, 09:50 PM
RE: Update on View Updates - by Forums - 03-01-2014, 07:13 PM
RE: Update on View Updates - by Forums - 03-01-2014, 10:00 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-03-2014, 09:38 AM
RE: Update on View Updates - by opto - 03-03-2014, 10:44 PM
RE: Update on View Updates - by serakfalcon - 03-04-2014, 12:35 PM
RE: Update on View Updates - by opto - 03-04-2014, 05:27 PM
RE: Update on View Updates - by Forums - 03-04-2014, 07:31 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 02:17 AM
RE: Update on View Updates - by Forums - 03-05-2014, 04:12 AM
RE: Update on View Updates - by opto - 03-04-2014, 08:15 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-05-2014, 01:40 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 04:03 PM
RE: Update on View Updates - by Forums - 03-05-2014, 09:56 PM
RE: Update on View Updates - by Exsonqu_Qu - 03-06-2014, 06:36 PM
RE: Update on View Updates - by Forums - 03-06-2014, 06:47 PM
RE: Update on View Updates - by Forums - 03-05-2014, 06:43 PM
RE: Update on View Updates - by serakfalcon - 03-05-2014, 10:58 PM
RE: Update on View Updates - by opto - 03-05-2014, 08:11 PM
RE: Update on View Updates - by Forums - 03-05-2014, 08:21 PM
RE: Update on View Updates - by Forums - 03-05-2014, 11:21 PM
RE: Update on View Updates - by serakfalcon - 03-06-2014, 12:54 AM
RE: Update on View Updates - by opto - 03-06-2014, 10:15 PM
RE: Update on View Updates - by serakfalcon - 03-08-2014, 03:34 AM
RE: Update on View Updates - by Forums - 03-09-2014, 06:43 AM
RE: Update on View Updates - by icedlava - 03-09-2014, 10:51 PM
RE: Update on View Updates - by Forums - 03-10-2014, 04:58 AM
RE: Update on View Updates - by serakfalcon - 03-10-2014, 04:08 PM
RE: Update on View Updates - by icedlava - 03-10-2014, 04:53 PM
RE: Update on View Updates - by serakfalcon - 03-19-2014, 07:12 PM
RE: Update on View Updates - by serakfalcon - 04-04-2014, 03:03 PM
RE: Update on View Updates - by icedlava - 04-04-2014, 06:12 PM
RE: Update on View Updates - by serakfalcon - 04-04-2014, 07:24 PM
RE: Update on View Updates - by serakfalcon - 05-07-2014, 07:07 PM
RE: Update on View Updates - by wubuer198 - 12-10-2015, 05:13 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)