Welcome Guest, Not a member yet? Register   Sign In
  Calling a model from another model?
Posted by: El Forum - 06-22-2008, 07:12 PM - Replies (28)

[eluser]mattalexx[/eluser]
What would be the syntax for calling another model's methods from within a model?


  Facebook/CI devs - Enable Query String must be TRUE or...?
Posted by: El Forum - 06-22-2008, 05:50 PM - Replies (3)

[eluser]spherop[/eluser]
so far i have been working under the assumption that I would have to set enable_query_string = true in order to handle Facebook's auth strings etc.

but i am new to CI ...so if someone has successfully stuck with CI segment urls in FB app dev, please inform.


  implementing per user home/url
Posted by: El Forum - 06-22-2008, 05:47 PM - Replies (2)

[eluser]spherop[/eluser]
pretty new to ci and loving it so far.

i am working on a web app which involves users sharing videos. i would like to implement the kind of feature you see on a site such as flickr, where a url such as http://www.flickr.com/photos/userx/ will present a public view of userx's image stream. so each user, with unique username, automatically has their own simple url to share with others.

so, with ci, any tips on whether/how this can be implemented?


  How to update reordenated menu items in DB
Posted by: El Forum - 06-22-2008, 05:43 PM - Replies (7)

[eluser]Rubiz'[/eluser]
Good night all.

My clients ( they really sucks ), want have a possibility to reorder the main site menu, and submenu.

Ok.

I added a column in DB called show_order, and got this jquery link http://dev.jquery.com/view/tags/ui/lates...i.sortable.

Than, I serialized the list itens and send organized to form inputs called session[], so I have all items organized perfectly.

My doubt is about how to update existent show_order in DB...

If I have first:
1
2
3
4
5

Than the client changes it to:
2
4
5
3
1

...

Cant think a way to update database with it...

Any idea?


  Adding querystrings
Posted by: El Forum - 06-22-2008, 05:31 PM - Replies (6)

[eluser]mattalexx[/eluser]
The problem with the whole "/controller/action/param1value/param2value/param3value" thing is, the parameters do not have keys and so flexibility is lost (what if I wanted to include param3 but not param1 or param2?). It would be cool if I could do something like this:

Code:
/controller/action/param1value/param3key:param3value
Or maybe this:
Code:
/controller/action/param1value?param3key=param3value
What's the best way to include variable parameters without making my life too difficult later on?


  dompdf help
Posted by: El Forum - 06-22-2008, 05:21 PM - No Replies

[eluser]Unknown[/eluser]
can anyone show me an example of dompdf at work?
I'm fairly new to php and was interested in the ability of using dompdf for one of my pages. i've read everything I'm come across regarding dompdf, but employing it still does not make sense to me. any help would be greatly appreciated. Thank you all.


  Should I start my model methods with an underscore?
Posted by: El Forum - 06-22-2008, 05:17 PM - Replies (1)

[eluser]EEssam[/eluser]
Hi,

I'm wondering if I should start my private model methods with an underscore, or it's already hidden?

Please advise.


  Best practice for including headers and footers
Posted by: El Forum - 06-22-2008, 05:06 PM - Replies (3)

[eluser]mattalexx[/eluser]
In my application's views folder, I created a CakePHP-esque layouts folder. With the layouts folder I put "front", "admin" and "minimal" folders. Within each of these, I put a header.php file and a footer.php file.

Right now, I am putting this code into my controller to include headers and footers:

Code:
class Items extends Controller {

   function view($id) {

      // Get item
      // ...

      // Render
      $this->load->view("layouts/front/header", array('page_title' => $data['item']['title']));
      $this->load->view("items/view", $data);
      $this->load->view("layouts/front/footer");
   }

}
What I'm asking is, is there a better way to go about applying layouts than this?


  Creating SOAP service, issue with Controller
Posted by: El Forum - 06-22-2008, 04:40 PM - Replies (6)

[eluser]stevefink[/eluser]
Hi all,

I created a demo SOAP service that I plan to build out a complete Web API for on top of Code Igniter for my application. My SOAP service works just fine when I slap together some scripts, however, when it comes time to add the stuff into CI, stuff breaks.

An example of my Controller looks like the following:

Code:
<?php

class Soap extends Controller {
    
    function Soap()
    {
        parent::Controller();
        
        /**
         * Start SOAP service
         */                  
        $server = new SoapServer('http://foo/path/to/bar.wsdl');
        $server->addFunction('Demo');
        $server->handle();
    }                    
    
    function Demo($param1)
    {
        return 'Request received with param1 = ' . $param1;
    }  
    
}

When I call my client side code, I get the following error output:

Fatal error: SOAP Fault: (faultcode: SOAP-ENV:Server, faultstring: SoapServer::addFunction() [<a href='function.SoapServer-addFunction'>function.SoapServer-addFunction</a>]: Tried to add a non existant function 'Demo') in /www/ll-prod-api/api/soap.php on line

It appears it doesn't recognize my function Demo() at all.

I've also tried using something similar to:

Code:
$server->addFunction($this->Demo);

It would be great if I can get my SOAP functionality working in this fashion as then I can leverage my models for the business logic of the web service. Then I can create rest.php, xmlrpc.php and so on. The beauty of MVC.

If anyone can point me in the correct direction, that would be sweet.

Thanks all!


  Model loading problem
Posted by: El Forum - 06-22-2008, 04:21 PM - Replies (1)

[eluser]Nial[/eluser]
I have a model, Job_handler, which calls a second model, User_handler.

I have number of models which all load fine. For some reason, I receive an error when trying to load User_handler. I receive the following error:

Quote:Call to a member function fetch_tags() on a non-object
.

Obviously, this means that User_handler isn't being loaded correctly. I've also manually checked and its constructor is never triggered. I'm sure this is some simple error I've missed, but right now I'm pulling my hair out!

Job_handler model file (job_handler.php):
Code:
class Job_handler extends Model {

    function Job_handler() {
        parent::Model();
    }
    
    function fetch( $page ) {
        
        $this->load->model('User_handler');
        $this->User_handler->fetch_tags();

    }
}

User_handler model file (user_handler.php):
Code:
class User_handler extends Model {

    function User_handler() {
        parent::Model();
    }
    
    function fetch_tags() {
        
        // Yadda yadda
        
    }
    
}


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

Username
  

Password
  





Latest Threads
Codeigniter Shield Bannin...
by kenjis
44 minutes ago
SQL server connection not...
by kenjis
1 hour ago
Best way to create micros...
by kenjis
3 hours ago
How to use Codeigniter wi...
by kenjis
3 hours ago
Getting supportedLocales ...
by kcs
9 hours ago
Component help
by FlashMaster
Today, 01:41 AM
Show logo in email inbox
by WiParson
Today, 12:48 AM
CI 4.5.1 CSRF - The actio...
by jackvaughn03
Yesterday, 10:17 PM
Limiting Stack Trace Erro...
by byrallier
Yesterday, 02:21 PM
Bug with sessions CI 4.5....
by ALTITUDE_DEV
Yesterday, 01:36 PM

Forum Statistics
» Members: 85,228
» Latest member: 789club15vip
» Forum threads: 77,577
» Forum posts: 375,977

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB