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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 18,617
» Latest member: bocil
» Forum threads: 71,765
» Forum posts: 368,214

Full Statistics

Latest Threads
Problem with redirect-> t...
Forum: CodeIgniter 4 Support
1 hour ago
» Replies: 1   » Views: 14
Filter arguments - howto?
Forum: CodeIgniter 4 Support
1 hour ago
» Replies: 0   » Views: 6
Pagination negative offse...
Forum: CodeIgniter 3.x
2 hours ago
» Replies: 1   » Views: 95
Detecting Model->delete()...
Forum: CodeIgniter 4 Support
4 hours ago
» Replies: 2   » Views: 88
Problem with routes if Co...
Forum: CodeIgniter 4 Support
4 hours ago
» Replies: 10   » Views: 204
Logging all sql-queries
Forum: CodeIgniter 3.x
7 hours ago
» Replies: 2   » Views: 40
How to return $data to mo...
Forum: General Help
8 hours ago
» Replies: 0   » Views: 13
Using cache Redis questio...
Forum: CodeIgniter 4 Support
11 hours ago
» Replies: 1   » Views: 45
Cart and Paypal integrati...
Forum: CodeIgniter 4 Feature Requests
11 hours ago
» Replies: 3   » Views: 83
Testing: Database refresh...
Forum: CodeIgniter 4 Discussion
11 hours ago
» Replies: 2   » Views: 49

  URI Segment.
Posted by: El Forum - 06-22-2007, 02:29 AM - Forum: Archived Development & Programming - Replies (9)

Was wondering how do I find out what the current URI segment 3 is equal to...?

Basically I have a header that gets pulled into different pages, and usuing that header I want to know what the current page is so I can place a bit of code into the header that will relate to the page,
FYI, using variables will not work, I have multiple places to place the code, each being different for the different pages.

  Integrate Facebook Php Client
Posted by: El Forum - 06-21-2007, 11:56 PM - Forum: Archived Development & Programming - Replies (30)

Trying to integrate Facebook Php Client to Igniter. Any suggestions on how to do that? Copying their files to system/libraries does seems to work for me.



Posted by: El Forum - 06-21-2007, 07:05 PM - Forum: Archived General Discussion - Replies (4)


I have a application with a menubar anda a secundary left menu that is called by a simple innerHTML javascript.
the code is

the extract of view file:

<div id="menu">
<ul id="menubarra">
<li>&lt;a onclick="montamenu('ensino')"&gt;ensino</a></li>
<li>&lt;a onclick="montamenu('pesquisa')"&gt;pesquisa</a></li>
<li>&lt;a onclick="montamenu('extensao')"&gt;extens&atilde;o</a></li>
<div id="menuesquerda"> // the div to put the secundary menu.

the javascript code:

function montamenu(menu) {
if (menu=='ensino') {
var leftmenu = "<ul><li><a href="+base_url+"ensino/habilitacoes>habilita&ccedil;&otilde;es</a></li>"+
"<li><a href="+base_url+"ensino/disciplinas>disciplinas</a></li>"+
"<li><a href="+base_url+"ensino/docentes>docentes</a></li>"+
"<li><a href="+base_url+"ensino/vestibular>Informa&ccedil;&otilde;es ao vestibulando</a></li></ul>"
} else if (menu=='pesquisa')
var leftmenu = "<ul><li><a href="+base_url+"pesquisa/projetos>Projetos em Andamento</a></li>"+
"<li><a href="+base_url+"pesquisa/publicacoes'>Publica&ccedil;&otilde;es</a></li>"+
"<li><a href="+base_url+"pesquisa/tcc>TCC&acute;S dos Alunos</a></li></ul>"
else {
var leftmenu = "<ul><li><a href="+base_url+"extensao/projetos>Projetos em Andamento</a></li>"

the question is:

In the firefox browser everething is ok but they don´t work in IE.

Someone could help?

  Controllers in Two-Level Sub Directory Fail!
Posted by: El Forum - 06-21-2007, 05:50 PM - Forum: Archived Development & Programming - Replies (2)

[eluser]Phil Sturgeon[/eluser]
I have most of my controllers in /controllers/admincp/ as this is the biggest part of my system. However with the increase in files, i tried making another subdirectory /controllers/admincp/settings/ and no joy.

Tried making /admincp/test/stuff with in index() that runs echo "poo"; but nothing there either, I just get 404 every time.

I assume this is not personal error, is this a bug others have ever run into?

  Is CI able to handle a multi-user blog?
Posted by: El Forum - 06-21-2007, 12:34 PM - Forum: Archived Development & Programming - Replies (8)

I've looked at the authentication_lite plugin. It seems to do a good job at managing user levels but not individual users. If I wanted to create a site that allowed multiple users to submit blog entries, is CI capable of restricting users to editing/deleting only the entries they've created?

I've been using WordPress (built on PHP) for some time now but have found that I will need to seriously alter it for a future project. I was hoping that I could use something like CI to build from scratch rather than modifying WP. What do you think?

  model not loading :(
Posted by: El Forum - 06-21-2007, 12:23 PM - Forum: Archived Development & Programming - Replies (2)

Hi everyone.

I'm having a problem getting a model to load. I'm getting this error:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: User::$load
Filename: controllers/user.php
Line Number: 6

Fatal error: Call to a member function model() on a non-object in C:\dev\xampplite\htdocs\ci\system\application\controllers\user.php on line 6

And here is my Controller
class User extends Controller {
    function user()
Any idea's on why I might be getting this error?

Any idea

  Integrating R&OS PDF generator in CI
Posted by: El Forum - 06-21-2007, 09:16 AM - Forum: Archived Development & Programming - Replies (3)

Hi. After a long search I decided to pick R&OS PDF generation classes and try to integrate it into CI.
I know, it's sooo far from being perfect, but being stuck to PHP4 I couldn't find anything better...

Unfortunately, I'm still a first-timer OO coder and I don't find it easy to understand the necessary steps to integrate such classes and make a CI library or what else out of it.

Does anybody want to help me and release a solution (hopefully useful to the community...)?

Well, that's what I did.
Downloaded the classes athttp://www.ros.co.nz.pdf, unzippd and I got:
- class.pdf.php
- class.ezpdf.php
- fonts folder
- readme.php (which actually calls the classes to produce the pdf file)
- data.txt (a text file with the content to be pdf'd)

I followed Danfreak advice and created a folder "my_classes" into the Application folder.
Then I put into "my_classes" the 'class' files and the fonts folder.

I added the 'ini_set' thing into the index.php file to make CI load the folder 'my_classes' (see this link).

Am I doing right till now? Well, now I took a controller 'page' and
added a function 'createpdf'.

function createpdf()
    $pdf =& new Cezpdf();
    $pdf->ezText('Hello World!',50);

The $pdf lines are taken from a doc example.
I get as output a text page which notifies an undefined index error.
in the class.pdf.php file, on line 1934.

Anybody willing to help me?

I'd really appreciate any help. Thanks a lot.

  warning "missing argument"
Posted by: El Forum - 06-21-2007, 09:11 AM - Forum: Archived Development & Programming - Replies (6)


i have a model with a function which has some arguments with default values like...

function doSomething($arg1, $arg2="foo") { ... }

calling that function from a controller like....


returns a warning message saying
Quote:Missing argument 2 for Foo_model::doSomething(), called in /path/to/file.php on line XX and defined

what i'm doing wrong?


  Automated Form Generation
Posted by: El Forum - 06-21-2007, 08:53 AM - Forum: Archived Libraries & Helpers - Replies (12)

[eluser]Phil Sturgeon[/eluser]
Call me lazy but there is nothing more boring than making 100's of CRUD forms for your new admin control panel. There are a few solutions:

Scaffolding: Sadly short term solution and has its obvious flaws like cannot access NULL values and needs a separate controller for each damn table.

CodeCrafter: Is a very intelligent piece of coding, sites that code themselves are not only a dream but in some ways a nightmare... this is my job you are stealing here!! However the code is a little OTT, makes too many folders and is not the best solution.

Rapyd: Any idea how the hell to make this work? Takes me a long time of faffing just to get a simple form done, and again, includes HUNDREDS of files!

Is there any solution to simply create a really simple form from a database? Like, one single controller with a parameter accepting a table name which passes to a library to return a dynamically generated view?

There is no need for all this "Comes with 6 million Javascript libraries and requires a new folder in every single CI folder" its OTT and messy. I do hope there is another CRUD solution as coding one myself would take even longer than making the forms :p

  Fatal error: Call to a member function query() while my class extends controller
Posted by: El Forum - 06-21-2007, 08:47 AM - Forum: Archived General Discussion - Replies (3)

I've made a class it's being loaded and everything is fine with that.
Unfortunately when I want to get access to database PHP generates me fallowing error:
Fatal error: Call to a member function query() on a non-object in D:\WWW\CodeIgniter\system\application\controllers\news.php on line 8

File looks like that:

class News extends Controller {
    function index()
        $this->lang = $this->lang->user_lang;
        $res = $this->db->query('SELECT * FROM `news` WHERE lang=\''.$this->lang.'\' ORDER BY n_timestamp');
        if($res->num_rows() > 0)
            foreach($res->result_array() as $row)
                $cnt = '<div id="news">
                            <div class="title">'.$row['n_title'].'</div>
                             <div class="date">'.date('H:i d.m.Y', strtotime($row['n_timestamp'])).'</div>
                             <div class="content">'.nl2br($row['n_content']).'</div>
        $vars = array('lang' => $this->lang, 'title' => $this->get_title(), 'content' => $cnt);
    function get_title()
        $titles['pl'] = 'Nowosci';
        $titles['en'] = 'News';
        return $titles[$this->lang];
I've figure out that the problem is in Loader.
It doesn't returns me anything and I don't know why but when it's called by Session class everything is fine. What should I do ?
Ok now i know why.
Library classes can't extend controller.
Then how to use for example view in my Lib class ?

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.