Welcome Guest, Not a member yet? Register   Sign In
Is there an integration of CodeIgniter with dojo?
#1

[eluser]Unknown[/eluser]
Hi,

I'm trying to integrating codeigniter with dojo but i have some problems. Is there any turorial out there? I was looking for something in Google but nothing interesting.

I want something that let my application show some database data without reload it.

I like dojo because is well document it, but i want work with codeigniter, not only with PHP and dojo.

Thanks a lot,
#2

[eluser]Mirage[/eluser]
CI doesn't "built-in" support for any given Javascript framework. I frankly don't really know what the point of that would be. I know other frameworks have done it. But you don't script dojo (or javascript) in CI. In order to get the functionality you want you direct a Dojo AJAX request at a controller that returns the expected data the same way it would return any other output.

Myself I just ExtJS a lot and some jQuery. There's nothing special I do in CI other than have Controllers generate appropriate output given the call.

HTH
m
#3

[eluser]Unknown[/eluser]
You are right!

I made a wrong question, i just want to know how can i make dojo work in my codeigniter application. I follow an instructions from a book and i solve this problem.
#4

[eluser]Unknown[/eluser]
Hi! can you point me that example which can help me to figure out how to effectively work with both.
Regards
#5

[eluser]henrihnr[/eluser]
Hi...i just started to prepare for building site with CI and Dojo.
CodeIgniter doesnt provide a way to include your js or css files in CodeIgniter subfolder...
But you can include these files using base_url() function and this technique should works fine with Dojo.
Here's how i put it in action:

wwwFolder
\CodeIgniter
\dojoroot
\css
\system
\others

in my view files, i called dojo like this:

<style type="text/css">
@import "<?php echo base_url(); ?>dojoroot/dijit/themes/tundra/tundra.css";
@import "<?php echo base_url(); ?>dojoroot/dojo/resources/dojo.css";
</style>
#6

[eluser]Colin Williams[/eluser]
CI doesn't dictate where you put any CSS, images, JS files, etc. Put them on your server, and provide the right location of where you put them.

http://en.wikipedia.org/wiki/Absolute_path
#7

[eluser]Gabriel Jones[/eluser]
@henrihnr - Why not use google code or yahoo api and pull down from their CDN? Saves you bandwidth, and you never have to worry about it.

Just a general statement to all.. ExtJS and jQuery are great packages, I use them on some projects. But since I have been working on development of charting widgets for Dojo, I have come to see that processing Dojo generally is 2 times faster than all other packages available. I strongly recommend to anyone who is hasnt given Dojo a chance to do so. Im not trying to sell up Dojo here, but trust me, I couldnt believe it either...

Anywho, long story short, give Dojo 1.3.0 a try in your next project, you wont regret it. The only thing I dont like about Dojo is its horrible documentation, or the lack there of.
#8

[eluser]slowgary[/eluser]
Dojo is fastest than most others but in recent tests jQuery (ver 1.3.0) has shown to be faster or not far behind, and personally I find it much easier to use. It DEFINITELY has better documentation. Whatever your preference, I agree 100% with Gabriel, do everyone a favor and include your javascript framework from google's servers. Not only does it save your server the bandwidth, but most visitors already have these frameworks cached from another site. It's so much better than in the past where your average browser had 100's of copies of the same JS file cached from different sites.

Also, to reiterate, CI doesn't need to 'support' any JS framework, just use the framework as you normally would, including it in your view. For AJAX calls, use your normal CodeIgniter url, like so:
Code:
//jQuery AJAX call
$.ajax({
   type: "POST",
   url: "controller/method",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
});

If needed, you could also skip the 'data' and just work it into 'url' for CI style urls.
#9

[eluser]Gabriel Jones[/eluser]
@slowgary - good point, not only does it save server bandwidth but it saves HD space too! I bet there's even a way its good for the environment! :-)

I know this may be a bit biased, but try this js benchmark test suite out. I ran this under FF2/3 & IE6/7 as well as Safari, and in all cases Dojo 1.3.0 out performed. Im curious to see others' results.

And slowgary you bring up a good point too, in that jQuery is easier to use. Personally I feel that as long as the package is easier for the developer to work with and the load/render times arent terrible, why not go with the easier solution. I think it comes down to learning curve. The learning curve on jQuery is short compared to that of Dojo, there's simply more documentation and community feedback, and yes syntactically, much easier to handle.
#10

[eluser]slowgary[/eluser]
The test may be biased, but mosts tests I've seen have Dojo at the top most of the time. There are many times, however, that jQuery wins and it's almost always a close second place.

When it comes down to it, prototype and mooTools (which I think is based off prototype) both seem to be lagging in the performance department.

As for jQuery and Dojo, they're both great and as long as development continues the way it has, they'll continue to trump eachother speedwise. So when you take performance out of the equation, I opt for easiest learning curve. jQuery wins.




Theme © iAndrew 2016 - Forum software by © MyBB