Welcome Guest, Not a member yet? Register   Sign In
  XML Parsing problem using simpleXML
Posted by: El Forum - 02-25-2008, 03:48 AM - Replies (4)

[eluser]bijon[/eluser]
I am trying to parse an XML data using the simplexml .I get the nested object .I am not able to parse that nested object . Here is the sample code.

Code:
url    = "http://usp1.blinkx.com/partnerapi/user/?uid=1ibdckbebe&text=cricket";
$xmlstr = file_get_contents($url);
$xml = simplexml_load_string($xmlstr);
print_r ($xml);
echo $xml->action;
And i got the output like
Quote: SimpleXMLElement Object
(
[action] => QUERY
[response] => SUCCESS
[responsedata] => SimpleXMLElement Object
(
)

)
QUERY
So now how can i parse the data of responsedata


  Modular Extensions - (HMVC) - Version 3.1.9
Posted by: El Forum - 02-25-2008, 03:33 AM - Replies (133)

[eluser]wiredesignz[/eluser]
This is Version 3 of the Modular Extension system. (3rd re-write)

The Modular Extension directories can now be organised with proper structure: ie Config, Controllers Libraries, Models, Views, Helpers and Plugins.

The module class loader is now an extension of CI_Loader allowing developers to configure how their classes are loaded and instantiated. A module can also replace its own class loader if something more custom is needed.

Version 3.1.9 is available on the wiki. Modular Extensions - (HMVC)

file is available for download: http://codeigniter.com/wiki/File:modular...s_319.zip/

Any feedback would be appreciated.


  Search in three table same time
Posted by: El Forum - 02-25-2008, 03:21 AM - Replies (9)

[eluser]Sawariya[/eluser]
Hi friends

How to search in three tables at same time... here i think join is not possible..
any idea..??

expecting your help...


  Routing question
Posted by: El Forum - 02-25-2008, 02:35 AM - Replies (2)

[eluser]evgeny_likov[/eluser]
I want to make path like /users/25345. Is there a way to do it?

(i heard, http://moddb.com based on codeigniter?)


  Oobleck - A patterned approach to dealing with forms and databases in CI controllers
Posted by: El Forum - 02-25-2008, 02:23 AM - Replies (12)

[eluser]webthink[/eluser]
Explanation with examples can be found <a href="http://webthink.ca/oobleck">Here</a>

During Webthink's last major project we noticed that a lot of time was spent writing controller code to deal with forms and and database interactivity. It seemed we were writing a lot of lines to accomplish the same basic actions with only minor variance from one controller to the next. Lists of form/db fields tended to be written on average about 4 times. a)to set up fields for validation b)to set up rules for validation c)to assign data from the db to an array to be used for defaulting forms d)to assign data from forms to an array to be used to write to the db. In addition to this a lot of procedural logic used to ferry data from the form to the db and vice-versa was repeated.

At it's core a controller is designed to handle control flow logic and business logic so we came up with an approach that seperates this from a lot of the repetative grunt work tasks that were rapidly filling up our controllers. The approach is two pronged: It relies on a pattern by which you organize your controller and a library to abstract some of the control code.

Keep in mind though that it really is just an approach. It's meant to be altered to fit your needs. You could theoretically use as little or as much of it as you please or simply give it a look over and implement something similar but better suited to your needs.

Some credit for inspiration at least has to be given to Michael Wales and his <a href="http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/">ErkanaAuth project.</a> We looked at it, liked it, and then decided not to use it. There in lies the beauty of it though. It's less of package and more of a suggested approach so when we looked over it we thought 'It's simple, it's elegant and there's really nothing to it. Let's write our own'. My hope is that Oobleck gets treated in much the same way. It's not a packaged solution it's more of a design philosphy from which people are free to take what they like. To the best of my ability I've designed it to be as non-invasive as possible but it is a rethink to the way we code controllers so requires a certain amount of buy in.

Additionally the motivation to abstract a lot of our controller code came after we did the same for our models. For that we adopted <a href="http://codeigniter.com/wiki/ActiveRecord_Class_Mod/">CoolIce's Active Record ORM Library</a> and in doing so completely stripped down our models.

The code is still in Beta so We'll be fixing it up as we go along. As we continue to develop and use Oobleck more for our own projects I hope to develop more flexibility into it so that it can handle more non standard scenarios. With one exception there won't be any feature development only development in expanding it's flexibility. That exception is of course a form generator. It seems a naturual fit and webthink->Andrew who does much of our front end implementation has a lot of experience with these sort of things. Whatever we do come up with will have to hang off of Oobleck but more than that it will have follow the same principles and be fully overridable and non-invasive.

Why Oobleck? Well mostly because "A patterned and abstracted approach to interfacing user input forms and database interaction within CodeIgniter controllers" doesn't lend itself very easily to a clever acronym. We needed a made up word. Fortunately <a href="http://en.wikipedia.org/wiki/Oobleck">Dr. Suess provided us with a great one</a>

Hope it can be of use to someone.

webthink->Julian


  URI Library (v1.6.1) - small optimization suggestion
Posted by: El Forum - 02-25-2008, 12:47 AM - Replies (1)

[eluser]coolfactor[/eluser]
The _reindex_segments() function is a tad long in the tooth for what it does.

Here is the current version:

Code:
function _reindex_segments()
{
    $i = 1;

    foreach ($this->segments as $val)
    {
        $this->segments[$i++] = $val;
    }

    unset($this->segments[0]);
        
    $i = 1;
        
    foreach ($this->rsegments as $val)
    {
        $this->rsegments[$i++] = $val;
    }
        
    unset($this->rsegments[0]);
}

The same thing can be accomplished in fewer lines using native PHP functions. No need for the overhead of looping:
Code:
function _reindex_segments() {

    array_unshift($this->segments, NULL);
    unset($this->segments[0]);

    array_unshift($this->rsegments, NULL);
    unset($this->rsegments[0];

}


  Router.php url problem
Posted by: El Forum - 02-25-2008, 12:20 AM - No Replies

[eluser]badgeek[/eluser]
when im trying to open this url:

http://127.0.0.1/master/CodeIgniter_1.6.....php?/////

it produce:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/Router.php

Line Number: 190


  Active Record and large result sets
Posted by: El Forum - 02-24-2008, 10:27 PM - Replies (4)

[eluser]BlueCamel[/eluser]
I'm dealing with large result sets from my SQL queries and using active record. I don't want to return the entire result set into memory. Instead, I want to step through the results row by row (think cursor).

So, I think AR by default returns a total count for MySQL results. Because of this isn't the entire result set stored in memory? If I disable the total count, will I be able to step through the results without storing the entire set in memory?

Did this make any sense? Smile


  REST library for php4?
Posted by: El Forum - 02-24-2008, 09:30 PM - Replies (1)

[eluser]badgeek[/eluser]
is there any php4 based REST library?


  Database trouble - Error Number: 1096
Posted by: El Forum - 02-24-2008, 08:21 PM - Replies (13)

[eluser]coldKingdom[/eluser]
I get this message

Quote:An Error Was Encountered

Error Number: 1096

No tables used

SELECT *

when i use

Quote://Get data from the database
$this->db->select("*");
$this->db->from('tbl_gallery');
$this->db->join("tbl_users", "gallery_user = usr_id");
$this->db->join("tbl_gallery_albums", "gallery_album = album_id");
$this->db->where('gallery_user', $userid);
$this->db->where('gallery_album', $gallery);
$this->db->order_by('gallery_album');
$this->db->order_by('gallery_uploaded', 'DESC');
$this->db->limit($limit, $offset);

$this->db->count_all_results(); //This one troubles me

When i delete the line $this->db->count_all_results(); everything works perfectly.

I run CI 1.6.1 and MySQL

Thanks!


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Cache best practice?
by BhambriRohunu
28 minutes ago
CI 4.5.1 CSRF - The actio...
by BhambriRohunu
37 minutes ago
Bug with sessions CI 4.5....
by InsiteFX
56 minutes ago
Codeigniter Shield Bannin...
by kenjis
5 hours ago
SQL server connection not...
by kenjis
5 hours ago
Best way to create micros...
by kenjis
7 hours ago
How to use Codeigniter wi...
by kenjis
7 hours ago
Getting supportedLocales ...
by kcs
Today, 09:30 AM
Component help
by FlashMaster
Today, 01:41 AM
Show logo in email inbox
by WiParson
Today, 12:48 AM

Forum Statistics
» Members: 85,266
» Latest member: webpulseindia01
» Forum threads: 77,577
» Forum posts: 375,980

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB