Welcome Guest, Not a member yet? Register   Sign In
Any plans for CI and JS frameworks?
#1

[eluser]Ahmed Nuaman[/eluser]
I'm a big fan of CI, it's really made writing sites nice and quick and pleasant.

At the mo, I'm using Prototype with Script.aculo.us. I was wondering if, in the near future, CI's going to be deployed with a JS framework in mind?
#2

[eluser]ejangi[/eluser]
At this stage non of the core CI code needs JavaScript, so there's not really any sense in including a particular framework in the download. This is actually preferred for many developers as they can choose the JS framework they like and are comfortable with per project.
#3

[eluser]Ahmed Nuaman[/eluser]
Ok fair enough, well do you know if I can pass headers from CI while output compression is on. I have a feeling I can't, but I'll try anyway!
#4

[eluser]xwero[/eluser]
you have to use the php header function, it should do his work
Code:
class Somecontroller extends controller
{
   // constructor
   function Mypage()
   {
     header('Content-type: text/xml');
     $this->load->view('xmlview');
   }
}
The standard type is text/html
#5

[eluser]Ahmed Nuaman[/eluser]
I thought so, but I also though this may affect the output compression.
#6

[eluser]xwero[/eluser]
The header is send before the output compression starts so i don't know how it could be affected? But if you experience otherwise let us know something.
#7

[eluser]Ahmed Nuaman[/eluser]
Ah ok, no worries. Sorry, my lack of understanding for output buffering.
#8

[eluser]Sarre[/eluser]
Frankly, I've never understood why people even want their php framework to include javascript libraries...
Just write your javascript apart, in an unobtrusive way. All the major libraries offer methods to add events to dom objects, so there's no need to output your javascript through a php framework, right?
#9

[eluser]Ahmed Nuaman[/eluser]
Yes I see your point, but, it would be nice to have built in functions that:

- Wrote out a JS script response (with text/js as a header)
- Wrote out vars in XML for AJAX
- A specific AJAX controller (PHP side, not client side)

I'm saying this not to get CI to stick to a JS framework, but for CI to incorporate standard JS responses that any JS framework can make.
#10

[eluser]lifewithryan[/eluser]
My vote is to certainly NOT include any JS framework...

I like that CI is very minimal and gets out of the way. I hate when a framework builds in someother frameworks and leave you kind of "stuck" using the framework of their choice. (Rails comes with prototype, etc...thought apparently you can change it up, but its 'bloat' in my book).

I think decisions like JS frameworks are always best left up to the developer of the app in question...perhaps JQuery is a better solution for someone, rather than prototype/scriptaculous etc...or if you have to plug your app into an existing environment where a JS standard has already been established, etc...

Just make my life easy and get out of the way...thats my kind of framework.

Again, just my 2Mhz




Theme © iAndrew 2016 - Forum software by © MyBB