Welcome Guest, Not a member yet? Register   Sign In
  How to call CI specific functions on view files?
Posted by: El Forum - 09-05-2008, 07:02 PM - Replies (2)

[eluser]cyberbuff[/eluser]
Hello,
I have a common header. I want to show some data to the view file (ie header_view.php). I can always pass data to it from controllers. but in that way, i am repeating myself a lot. Is there any way to call CI specific functions on view files?
Regards
Abhisek


  Anyone use CI with Nginx?
Posted by: El Forum - 09-05-2008, 06:59 PM - Replies (14)

[eluser]John Fuller[/eluser]
And if so, are you able to use CI without adding the query string after index.php to view your controller methods?

Looking all over the net, I see instructions on "how to get CodeIgniter to work with Nginx" but that isn't my problem. CodeIgniter works if I add the query string.

I imagine this is the same problem as ExpressionEngine. I can't figure out how to configure Nginx to deliver the proper PATH_INFO information.

I'm using Nginx with FastCGI if that helps. Just as with anything in the open source ecosystem, the more I Google and read the more I pick up. Unfortunately I don't have the man hours to spend on this problem to figure it out all the way.

Other options are to live with the query string. Remove it using the Nginx rewrite module. Or just use Apache like every other sane individual. Wink


  Problem with .htaccess on localhost
Posted by: El Forum - 09-05-2008, 05:30 PM - Replies (5)

[eluser]Bramme[/eluser]
Hey all,

I'm experiencing some trouble with my .htaccess file on my localhost, running Ubuntu Hardy Heron. I've created my .htaccess file:

Code:
Options -Indexes
Options +FollowSymLinks

DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on
    
    RewriteCond $1 !^(index\.php|_assets)

    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>
I go to localhost, I see the standard welcome, I go to localhost/index.php?/welcome/ all is still fine. I go to localhost/welcome/ and I see a complete white page, with only two words in it: "index.php"

Does anybody know what could be causing this?


  Dealing with typelessness in SQLite
Posted by: El Forum - 09-05-2008, 03:12 PM - Replies (1)

[eluser]Xeoncross[/eluser]
I have been reading about SQLite 2 Data Types and SQLite 3 Data Types I discovered that in SQLite 2 there are only 2 types:

Quote:INTEGER (Primary key)
TEXT (everything else)

In SQLite 3 there are a few more:

Quote:NULL. The value is a NULL value.

INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.

TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16-LE).

BLOB. The value is a blob of data, stored exactly as it was input.


But even with these new types in SQLite 3 - you can store anything in any column (except id). So my question is - why even define the column type in "CREATE TABLE table" queries when it really doesn't seem to matter?

Basically is there anything wrong with this code?
Code:
CREATE TABLE posts(
id INTEGER PRIMARY KEY,
title,
text,
author,
time);


  Adding params to the pagination links .. or Sorting AND Pagination
Posted by: El Forum - 09-05-2008, 01:28 PM - Replies (4)

[eluser]jrlooney[/eluser]
So I am using the JavaScript method for sorting, so I have a table of data, User clicks on a column header and a JS sends the field name to a POST form. In the Model, if it sees 'sort' in input->post then it adds a ORDER BY clause to the query.

However, let's say user clicks "Organization" so they want the table to sort on Org., then they click Page 2 in the pagination links. They lose the sort because it's not passed in the pagination link. Is there anyway to tack params onto the pagination links so that I can tack on something like /sort/organization ?

thanks in advance

Edit:
Or does anyone have a better method of sorting and at the same time maintaining the pagination?


  Flexigrid CodeIgniter Implementation
Posted by: El Forum - 09-05-2008, 01:07 PM - Replies (128)

[eluser]Armorfist[/eluser]
Hello,

I just finished some documentation on the Flexigrid CodeIgniter Implementation. You can take a look in http://flexigrid.eyeviewdesign.com/ .
All feedback, improvements, etc are really welcome.

Thanks,
Frederico


  [resolved] Using flashdata on the same page
Posted by: El Forum - 09-05-2008, 11:10 AM - Replies (2)

[eluser]FinalFrag[/eluser]
Let me start of with a snippet of my view:

Code:
&lt;? if ($this->session->flashdata('message') != '') { ?&gt;
    <div id="feedback" class="&lt;?=$this->session->flashdata('class')?&gt;">
        <p>&lt;?=$this->session->flashdata('message')?&gt;</p>
    </div>
&lt;? } ?&gt;

What that does is pretty easy. When the 'message' is set in flashdata, it creates a div to show that message.

What I need is this message to show on the first page the visitor visits. So I've made my home controller (the first one the visitor sees when getting to my site). It looks like this:

Code:
class Home extends Controller {
    function index() {
        // Generate feedback
        $this->session->set_flashdata('class', 'notice');
        $this->session->set_flashdata('message', 'This website is a <abbr title="Work In Progress">WIP</abbr>.');
        
        redirect('home/showme', 'location');
    }
    
    function showme() {
        $data['header_pagetitle'] = 'Home';
        $data['header_menu'] = ul(array(anchor('', 'Home', array('id' => 'current-tab')), anchor('about', 'About me'), anchor('portfolio', 'Portfolio'), anchor('contact', 'Contact'), anchor('agenda', '_Agenda'), anchor('photos', '_Photos')));
        $data['header_title'] = 'Home';
        //$data['header_javascript'] = '';
        
        $this->load->view('home', $data);
    }
}

What this SHOULD do:
- generate the flashdata and save it in the session
- redirect to mysite.com/home/show
- create all the needed variables in the $data array
- show the home view

It does all that but there's just 1 problem. It shows the home view without a stylesheet Confused
Although, when I take a look at the source of that page it has included my style.css file.

When I try to change the redirect line to: redirect('otherpage', 'location'); it works. So I'm assuming this happens because I redirect to a function in the same controller. Could this be true?




Now you might say: 'just use $this->showme'. I could, but then the flashdata would not be shown on the view (because flashdata only shows on the next request).

Anyone got something on this issue?


  [resolved] help please: blank output after "Database Driver Class Initialized"
Posted by: El Forum - 09-05-2008, 09:54 AM - Replies (2)

[eluser]jonw[/eluser]
Hi folks,
Sorry for the lame problem but I'm looking at a blank browser window for every URL in my app with no idea how to progress.

I have PHP error logging & display enabled, error_reporting(E_ALL) in my index.php, $config['log_threshold'] = 3 set in the config, it's writing application logs OK and here's the output from one request;

DEBUG - 2008-09-06 15:37:55 --&gt; Config Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Hooks Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; URI Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; No URI present. Default controller set.
DEBUG - 2008-09-06 15:37:55 --&gt; Router Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Output Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Input Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2008-09-06 15:37:55 --&gt; Language Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Loader Class Initialized
DEBUG - 2008-09-06 15:37:55 --&gt; Config file loaded: config/authconfig.php
DEBUG - 2008-09-06 15:37:55 --&gt; Helpers loaded: array, form, auth, url
DEBUG - 2008-09-06 15:37:55 --&gt; Database Driver Class Initialized

... and that's all. What's annoying is I am tail -f 'ing the MySQL, Apache & CI error logs and I see no errors anywhere. How can I see the problem?

Some background info, I am currently trying to port an app I built in CI 151 to 163 on a new machine. Rather than trying to follow the ugrade instructions through alllll the versions I'm trying to port my old config, etc. options across piecemeal to a clean 163 install (bad idea?). What's stopping execution here is;
$autoload['libraries'] = array('database', 'Authlib');

As soon as I load either or both libraries the app dies.


  Facebook, invalid URI
Posted by: El Forum - 09-05-2008, 09:45 AM - Replies (6)

[eluser]wezzy[/eluser]
Hi, i'm trying to develop a new Facebook application using CI. I've choosen the IFRAME interface for my application and when i try to see the page i get "The URI you submitted has disallowed characters."

The problem is in the allowed characters that doesn't include "=" and "&". Just open /system/application/config/config.php and change the link 126 from:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

to

$config['permitted_uri_chars'] = '&=a-z 0-9~%.:_\-';

and everything seems to work.

Hope this helps


  DataMapper 1.6.0
Posted by: El Forum - 09-05-2008, 09:32 AM - Replies (1018)

[eluser]stensi[/eluser]
<b>UPDATE</b>

10 December 2008 - Version 1.6.0 Released (Current version)
6 December 2008 - Version 1.5.4 Released
5 December 2008 - Version 1.5.3 Released
4 December 2008 - Version 1.5.2 Released
4 December 2008 - Version 1.5.1 Released
3 December 2008 - Version 1.5.0 Released
15 October 2008 - Version 1.4.5 Released
13 October 2008 - Version 1.4.4 Released
13 October 2008 - Version 1.4.3 Released
12 October 2008 - Version 1.4.2 Released
11 October 2008 - Version 1.4.1 Released
11 October 2008 - Version 1.4 Released
8 October 2008 - Version 1.3.4 Released
3 October 2008 - Version 1.3.3 Released
2 October 2008 - Version 1.3.2 Released
2 October 2008 - Version 1.3.1 Released
29 September 2008 - Version 1.3.0 Released
24 September 2008 - Version 1.2.1 Released
17 September 2008 - Version 1.2 Released
7 September 2008 - Version 1.0 Released

View the Change Log to see what's changed.

____________________________________

My DataMapper is finished!

Ever since Michael Wales posted a sneak peak of the DataMapper ORM class he was working on, I was inspired to start making my own!

The concept of having your Database tables as objects, and being able to manipulate them and their relationships so easily was too appealing for me to wait. So, sorry if I'm stealing some of your thunder Michael :red:


<b>DataMapper</b>

DataMapper is an Object Relational Mapper written in PHP for CodeIgniter. It is designed to map your Database tables into easy to work with objects, fully aware of the relationships between each other.

<b>Features</b>
* Everything is an object!
* Easy to setup, easy to use.
* Custom Validation on object properties.
* Lazy Loading (related objects are only loaded upon access).
* Relations and their integrity are automatically managed for you.
* One to One, One to Many, and Many to Many relations fully supported.

I went to a lot of trouble designing this and have even gone so far as to fully document it with a dedicated User Guide!

DataMapper Source Files
DataMapper User Guide

Enjoy :-)


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

Username
  

Password
  





Latest Threads
Best Way to Implement Aff...
by InsiteFX
Yesterday, 03:06 AM
curl + response body
by michalsn
07-06-2025, 10:14 PM
AssetConnect - a powerful...
by Crenel
07-06-2025, 04:08 PM
twig and view cell
by foxbille
07-05-2025, 01:58 AM
The pipe operator in PHP ...
by InsiteFX
07-04-2025, 04:18 PM
Heads up for users using ...
by FlavioSuar
07-04-2025, 11:33 AM
Table (view class) Row ID
by grimpirate
07-03-2025, 11:22 PM
Happy 4th Everyone
by InsiteFX
07-03-2025, 09:31 PM
AbuseIPDB Module
by InsiteFX
07-03-2025, 09:27 PM
tool bar not showing
by Luiz Marin
07-03-2025, 04:46 AM

Forum Statistics
» Members: 155,483
» Latest member: citytime
» Forum threads: 78,441
» Forum posts: 379,735

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB