Welcome Guest, Not a member yet? Register   Sign In
Issues with Error Pages
#10

(09-23-2015, 02:01 PM)mwhitney Wrote: Honestly, when your table's row template is 200+ lines and you have nearly 200 lines of code (or maybe 200+, depending on how you format it) in a loop to prep the data passed from the controller to fit into that template, it means that either something went horribly wrong before you even got to the view, or the table is just too complicated for a simple view.

On the other hand, I can't help but think that some of the template is overly-complicated (I can only assume to simplify the script and CSS applied to it) and that it's sometimes harder to do something in a template than in either PHP or JavaScript.
I didnt really plan for it to get like that, lol. 

basically, I have the same view for editing/creating "partitions", so when you create a new one, you can click the Add Row button, and it adds rows to the table with new settings., those rows are added via jQuery from the template. 

Now that you created the "partition", when you go to edit it, those same rows are populated in the table, this time by PHP, but from the same template file, and you can add more rows via JS, also using the same template file... see why I wanted JS AND PHP template parser?

The rows have check boxes, links, buttons, radios, inputs, etc, so when the new rows are added, the php passes an array of the row settings to the template, and since the template is logic-less... its very messy..

Heres what the table looks like when its populated, you can see why it gets a little outa hand.
[Image: NzLH?response-content-disposition=inline...M3LSMN33SA]

I realize that this would be a lot less work using something like Angular, but im already so far into version 1.0, im just going to get this out, then ill work on 2.0, which will be much more stable and optimized (Laravel and Angular probably)
Reply


Messages In This Thread
Issues with Error Pages - by jLinux - 09-21-2015, 02:54 PM
RE: Issues with Error Pages - by mwhitney - 09-22-2015, 08:48 AM
RE: Issues with Error Pages - by jLinux - 09-22-2015, 09:36 AM
RE: Issues with Error Pages - by mwhitney - 09-23-2015, 07:57 AM
RE: Issues with Error Pages - by jLinux - 09-23-2015, 10:25 AM
RE: Issues with Error Pages - by mwhitney - 09-23-2015, 11:27 AM
RE: Issues with Error Pages - by jLinux - 09-23-2015, 12:57 PM
RE: Issues with Error Pages - by mwhitney - 09-23-2015, 02:01 PM
RE: Issues with Error Pages - by ivantcholakov - 09-23-2015, 04:07 PM
RE: Issues with Error Pages - by jLinux - 09-23-2015, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB