Welcome Guest, Not a member yet? Register   Sign In
back-end front end best practices
#1

[eluser]ssachan[/eluser]
Hello Developers,
I have developed a few apps using jquery and CI. However I wanted to know more on how we could better organize our code. For eg. my view file generally looks something like this
-
<HTML>
...
...
<BODY>
<?php ... some dynamic stuff ?>

</BODY>
</HTML>
[removed]
var someVar = <?=dynamically passed id ?>;
var someVar2 = <?=dynamically passed id ?>;

....
[removed]

It really gets messy. I have seen some coder echoing everything , something
like
echo "<HTML>";
But I believe that we should dynamically insert the elements since it has the following advantages.
1. You can actually design the page leaving gaps where data can be dynamically inserted.(using a WYSWUG)
2. Editing becomes a lot more easier
But with something like this, it becomes difficult to push in code in the include files.
For eg. if I have a common.js(which is a script included in a lot of common pages) cannot have dynamic values.

hence there is a divide. Also, I really don't find it useful to wrap around HTML form element with CI code, just adds another layer overhear

definitely worth a discussion. I would like to hear how coders have been successfully managing code.

thanks
Shikhar




Theme © iAndrew 2016 - Forum software by © MyBB