Celauran wrote:Explicit routing is far better than implicit. Your routes file should be a gateway into your application; anyone not familiar with the project should be able to gain a decent understanding of what's going on simply by looking at it. I commonly have routes files that are hundreds of lines long, and I think that's a good thing.
I've following issues:
1) here I'd like to send URL to the process_ajax function too
This, however, suggests you're trying to avoid some possible duplication, which is good.
Can you elaborate on what you're trying to accomplish (and, if applicable, what you're trying to avoid) and we'll see what we can come up with.
Hi Celauran,
Thanks much for your prompt and supportive reply.
A brief about application:
Have a nav bar on left. Created by a legacy code.
I added another category in nav-bar. illumina (please see attached screen shot nav_bar)
Illumina category has couple of interfaces:
1) samples - display a grid with all samples information.
sample here refer to DNA/genome collected. Say, nose swab collected in Arizona. (please see attached grid sample screen shot)
User can select rows, and send them to group analysis.
Here, the gird is generated as:
Code: Select all
$("#grid_illumina_samples").jqGrid({
datatype: "json",
url:'illumina/illumina_xhr_get_samples',
mtype: "GET",
//so on and so forth..
});
Request goes to routes.php from there, go to controller, and model.. send rows. and populate the grid.
On selecting samples from the above Gird, user can send these samples to create a bundle (a group) .. My code for this looks like:
Code: Select all
function submit_form(analysisName,sample_id){
$.ajax({
url:'illumina/submit_isolate_analysis',
type: 'POST',
//so on and so forth..
}
});
Again this goes to routes - controller and model..Dump the analysis name in database, etc.
---- ---------------------------------------
2) Now manage analysis:
This has a different grid (same theme, but different entries), but different features (button at the bottom): Group for analysis, manage tools, etc
And for each such GET/POST request I'm adding another line in my routes as shown in the post #1 .
---- ---------------------------------------
3, 4, 5: more interfaces, different grid, another features..
---- ---------------------------------------
I'm a noob, and without any guidance and experience in design of code, and layouts.
I feel that I'm just making routes page a mess, thus I thought if I can club all ajax, and send them to a mainIllumina's
process_ajax function, from there things can be handled as they have been.
I hope I made a little sense of my dilemma here.
Thank you again for your time.
