Joomla and Codeigniter |
[eluser]alejandronanez[/eluser]
Hi there, how are you guys. The thing is that now I'm developing a small web application with CI and later I will integrate it with Joomla in a wrapper. (I have to do this because the client has been working with Joomla from a long time ago) The thing is that I need to know what user is logged in (the user logs in with joomla) to know what method call with Codeigniter. Am I clear? Has anyone done this before? Thanks guys
[eluser]danielgrin[/eluser]
I based my solution on code found here http://forum.joomla.org/viewtopic.php?f=304&t=580193. At first I tried to load the Joomla framework within a CI library, but this caused a series of errors, and seemed like more trouble than it was worth. My current working solution is to use CURL to access a custom script. I'm sure this could be refined further but I needed a quick solution. JOOMLA SIDE (loads Joomla framework and returns logged in user object as JSON) file: get_joomla_user.php (could be in the site root or anywhere as long as paths are correct) Code: <?php CI SIDE - fetch user object via file_get_contents file: CI_APP_FOLDER/libraries/Joomla_user.php Code: <?php I hope this helps. Daniel
[eluser]gowrav vishwakarma[/eluser]
you should see USE CI FOR JOOMLA DEVELOPMENT or USING CI FOR JOOMLA DEVELOPMENT post a reply back to developer or forum if have any trouble ..
[eluser]gowrav vishwakarma[/eluser]
in any of your controller (made in xCIDEveloper) to know the current user logged in use the follwoing line.. Code: $current_user_id=JFactory::getUser()->id;
[eluser]danielgrin[/eluser]
My requirements were to bridge an existing CI application with Joomla so that they still functioned independently. Adding CI to work within Joomla components was not an option, although it looks like something I would like to explore in the future.
[eluser]gowrav vishwakarma[/eluser]
Well I haven't tried it a well but if you are good at CI internals then .. just replace this systems application with your one .. and yes don't forget to look at some config there in..
[eluser]gowrav vishwakarma[/eluser]
Now Develop for Joomla in CodeIgniter, xCIDeveloper 0.6 released. installs in Joomla 1.5, 1.6 and 1.7 in same way and components developed in xCI works same in any of joomla version. http://www.xavoc.com/ |
Welcome Guest, Not a member yet? Register Sign In |