Welcome Guest, Not a member yet? Register   Sign In
  Multiple Views & Dynamic Data
Posted by: El Forum - 08-08-2007, 11:27 AM - No Replies

[eluser]Freakish_05[/eluser]
Evening all,

Further to my thread about multiple smarty views with CI, I've ditched smarty is it seemed to make things far more complicated than using CI's views.

I how have a new problem....
My sidebars and navbars are very often run from databases and frequently use URL variables to return data.

What is the best method of doing this in CI? The php code obviously needs to run before CI outputs the final view.
If I understand the MVC approach correctly, I should be creating plugins for all of my sidebar elements and then wrapping them all up in an addtional plugin function which is called in each of my controllers.

All comments greatly appreciated,
Freakish_05


  Difficulty understanding how to code up a webpage
Posted by: El Forum - 08-08-2007, 10:23 AM - No Replies

[eluser]Carlton[/eluser]
Hi People,

I have been looking through the code igniter documentation for about 2 weeks now and started writing some code but having difficulty grasping how it is you should create a reusable structure for a web page.

Previously I would have created nav bars, side navs in seperate php files and used the include function to place them in certain places of a template. If I were to do something similar in Code Igniter would I need to use multiple views...e.g....

Code:
$this->load->view('header_view', $data);
$this->load->view('nav_view', $data);
$this->load->view('content_view', $data);
and the data variable may contain page specific elements...such as a title...is this approach correct?

Also, how can I avoid calling 3 views on every page...would I need some sort of web page class that each page (e.g. login, search, news) extends and can simply call some sort of method that renders my main structure (i.e. create header, nav and body...then if I need to alter this I can just do it in one place)

Hopefully this question makes sense, I think I will look into buying a book which covers OO web page development or something as I think I am missing something Smile

C


  Right justify numeric fields in table display
Posted by: El Forum - 08-08-2007, 10:20 AM - No Replies

[eluser]andycorpes[/eluser]
Hi Group,

I'm using the HTML table helper to create a table from a databaswe result. I can't figure out how to make the numeric columns right justified. Is there anyway to do this using the table template? or have i got to add each cell individually and specify an id or class attribute for each cell?

Andy


  Scaffolding URL issues
Posted by: El Forum - 08-08-2007, 10:17 AM - No Replies

[eluser]JonFS[/eluser]
Hi there,

I am brand new to Code Igniter and firstly let me please just say that I really like the way everything is laid out . . . it all appears very easy to use.

I do however have one quick problem . . . I am following the video tutorial to create a web blog and I have got as far as viewing the scaffolding page

eg.

localhost/~jon/CodeIgniter/index.php/blog/scaffolding/

Now I am presented with the option to create a new record or view records, however instead of being taken to the view page that displays the form . . . the url is simple appended to read as follows:

localhost/~jonmalyon/CodeIgniter/index.php/blog/scaffolding/index.php/blog/scaffolding/add

I have taken a look at the scaffolding class and believe that it has something to do with the anchor function and the base-uri . . . but I am struggling.

I would really appreciate it if someone could shed some light on this.

Cheers

Jon


  Digg/Vote UP/Down Issue
Posted by: El Forum - 08-08-2007, 10:00 AM - No Replies

[eluser]CodyPChristian[/eluser]
Hello I'm building a quote system where the users of the site can post quotes to and they can vote/digg them up and down, everything so far is going great but I have one slight problem and I don't understand which way to go with it. Here is the current code I have.

This is where I need the new code, this is the part I don't get how to do.

Code:
$order_id = '';

Here is the full code and the way it works is /quotes/$id/up or down
Code:
function up()
    {
        $order_id = '0';
        $id = $this->uri->segment(2);
        
        
        $this->db->where('id', $id);
        $this->db->set('order_id', $order_id);
        $this->db->update('quotes', $_POST);
        
        
        redirect('quotes');
        
    }
    
    function down()
    {
        $order_id = '0';
        $id = $this->uri->segment(2);
        
        
        $this->db->where('id', $id);
        $this->db->set('order_id', $order_id);
        $this->db->update('quotes', $_POST);
        
        
        redirect('quotes');
        
    }

I tested it above but entering a number in the $order_id and it does in fact update it to that number, so everything else is working fine, its just writing it to actually work.

I hope someone understands this. Thanks for the help!


  Session question?
Posted by: El Forum - 08-08-2007, 09:42 AM - No Replies

[eluser]Jamongkad[/eluser]
Hey guys! I know this may sound quite basic but I was wondering how can one use session variables to pass data from one page to another.

Like lets say I had multiple forms, the user would fill out data for page 1. Then he would jump to page 2 but still have the data store in a cookie from page 1, and so on and so forth. Until he reaches the final page where all of his data is summarized for him. And he sends it out as an email.

Are there any examples of that type of usage? I mean are there best practices with regards to how to use Code Igniter for such a task?


  "No input file specified." error
Posted by: El Forum - 08-08-2007, 09:06 AM - No Replies

[eluser]5ml[/eluser]
Hello,
I had been running CodeIgniter at my local server without any problems.
But after uploading the website to my hosting account, the system started to give the following error:

"No input file specified."

The homepage opens without any problems, but accessing the other controllers and functions gives the above mentioned error. What can be the problem?

Thanks.


  Planning / design document?
Posted by: El Forum - 08-08-2007, 08:46 AM - No Replies

[eluser]jabbett[/eluser]
I'm trying to take a fairly complex, enterprise PHP application and rearchitect it to use a development framework. So far, Code Igniter seems to provide the best balance of structure and flexibility, especially important for our group considering that most of our application's data is stored as XML and drawn from a web service (not just pulled from a database as many PHP frameworks assume/require).

I'd like to give my project a fighting chance, so I'm curious if anyone out there can suggest methodologies for planning a Code Igniter-enabled application; I guess it's mostly how to map out necessary models, views, and controllers, but maybe also how to identify the kinds of libraries to integrate, etc. If someone can post a successful design document, or point to any existing examples online, that would be ideal.


  Get current page so I can set the style to "active" in menu?
Posted by: El Forum - 08-08-2007, 08:14 AM - No Replies

[eluser]See64[/eluser]
I just can't find how to do this simple thing best: I am including a view called menu.php in my default view. Here I build the navigation according to your rights. This all works great, except how do I set the current page's class to something else? There is nothing in the URL helper to return the current page, and searching the forums didn't bring up anything, so I'm at a loss.


  Print_r (get_defined_vars()) gives a HUGE list... isn't that a problem?
Posted by: El Forum - 08-08-2007, 07:50 AM - No Replies

[eluser]See64[/eluser]
While debugging I used print_r(get_defined_vars()); to see if I had all my variables in order. Unfortunately this produced a HUGE list, even triggering a "PHP Fatal error: Allowed memory size" on the first try.

Why is this so huge? Isn't this bad for performance? (EditSmile Or is it because it says *RECURSION*?

I have a clean install of CodeIgniter running, with only FreakAuth and some very basic "hello world"-ing from myself.


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

Username
  

Password
  





Latest Threads
AbuseIPDB Module
by grimpirate
37 minutes ago
curl + response body
by okatse
40 minutes ago
Heads up for users using ...
by davis.lasis
11 hours ago
Tool bar not showing
by grimpirate
Yesterday, 10:37 AM
The Hidden Cost of “Innov...
by fcoder
Yesterday, 03:11 AM
tool bar not showing
by InsiteFX
07-01-2025, 09:09 PM
Validation does not appea...
by grimpirate
07-01-2025, 01:55 PM
Block IP addresses of bad...
by grimpirate
07-01-2025, 01:47 PM
Override Router
by grimpirate
07-01-2025, 01:30 PM
CodeIgniter.com - Report ...
by Vikas Mehta
06-30-2025, 10:30 AM

Forum Statistics
» Members: 154,435
» Latest member: rr88comse1
» Forum threads: 78,437
» Forum posts: 379,714

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB