Welcome Guest, Not a member yet? Register   Sign In
  when new CI version
Posted by: El Forum - 06-28-2007, 06:00 AM - No Replies

[eluser]EugeneS[/eluser]
any news about new CI version and if there be natively supported standard php sessions ?


  CodeIgniter and Joomla 1.5 findings
Posted by: El Forum - 06-28-2007, 05:41 AM - No Replies

[eluser]CI miller[/eluser]
Today I googled for "better than codeigniter" which produced only 2 results and one of them pointed me to Joomla Framework being better than CodeIgniter.

I am building a CMS with different modules (static files, product catalog, shopping cart etc) and was curious how am I doing comparing to Joomla. Right now I'm just developing the admin interface and I'm using a modified version of CodeIgniter

Here are some findings:
General settings:
- no cacheing, no loging, no output compression
- multilanguage application
- pentium IV 2gb RAM

My CMS & Framework
Page generated: edit form for a product
Included files: 30
Total execution time: 0.13secs

Joomla 1.5
Page generated: edit form for an article
Included files: 118
Total execution time: 0.38sec (without the framework inclusion... for some reason I couldn't include the benchmark class before the framework inclusion)

Obviously joomla is more feature-reach but 0.38secs/request seems a bit too much.

I would like to find how is your codeigniter application performing.
If you have some figures for other frameworks (drupal, symphony, cake) it would be great.

Disclaimer: This is not intended to start a flame war between applications/frameworks since each has it's own target audience and meets certain needs.


  cant run ci application at port 8080
Posted by: El Forum - 06-28-2007, 04:36 AM - No Replies

[eluser]Unknown[/eluser]
Hello all, i write an application with CI 1.53.
now i wants to run it on port 8080(apache 2.x)
but aways 500 error.
how can i do for this?

thanks.


  Trying to extend Loader to call app controllers
Posted by: El Forum - 06-28-2007, 04:21 AM - No Replies

[eluser]Stuart Marsh[/eluser]
Hi everyone.
I'm fairly new to CodeIgniter but I am already impressed by how flexible and easy it is.
However like many people on here I am disappointed that I cannot call controllers within controllers. I know it goes against the MVC structure and that helpers can be created but this would be a much more flexible way to do things.
So I have started to play with CodeIgniter and I'm trying to extend the Loader library so I can call other controllers. I have a library in my app called MY_Loader.php and this is what I have put in it:

Code:
class MY_Loader extends CI_Loader {
    
    /**
     * Constructor
     *
     * @access    public
     */
    function MY_Loader()
    {
        parent::CI_Loader();
    }
    
    /**
     * Controller Class Loader
     *
     * This function lets users load and instantiate controller classes.
     * It is designed to be called from a user's app controllers.
     *
     * @access    public
     * @param    string    the name of the class
     * @param    mixed    the optional parameters
     * @return    void
     */    
    function Controller($library = '', $params = NULL)
    {        
        if ($library == '')
        {
            return FALSE;
        }

        if (is_array($library))
        {
            foreach ($library as $class)
            {
                $this->_ci_load_controller_class($class, $params);
            }
        }
        else
        {
            $this->_ci_load_controller_class($library, $params);
        }
        
        $this->_ci_assign_to_models();
    }

    // --------------------------------------------------------------------
    
    /**
     * Load Controller class
     *
     * This function loads the requested controller class.
     *
     * @access    private
     * @param     string    the item that is being loaded
     * @param    mixed    any additional parameters
     * @return     void
     */
    function _ci_load_controller_class($class, $params = NULL)
    {    
        // Get the class name
        $class = str_replace(EXT, '', $class);

        // We'll test for both lowercase and capitalized versions of the file name
        foreach (array(ucfirst($class), strtolower($class)) as $class)
        {            
            // Lets search for the requested library file and load it.
            $is_duplicate = FALSE;
            for ($i = 1; $i < 3; $i++)
            {
                $path = ($i % 2) ? APPPATH : BASEPATH;    
                $fp = APPPATH.'controllers/'.$class.EXT;
                
                // Does the file exist?  No?  Bummer...
                if ( ! file_exists($fp))
                {
                    continue;
                }
                
                // Safety:  Was the class already loaded by a previous call?
                if (in_array($fp, $this->_ci_classes))
                {
                    $is_duplicate = TRUE;
                    log_message('debug', $class." class already loaded. Second attempt ignored.");
                    return;
                }
                
                include($fp);
                $this->_ci_classes[] = $fp;
                return $this->_ci_init_class($class, '', $params);
            }
        } // END FOREACH
        
        // If we got this far we were unable to find the requested class.
        // We do not issue errors if the load call failed due to a duplicate request
        if ($is_duplicate == FALSE)
        {
            log_message('error', "Unable to load the requested class: ".$class);
            show_error("Unable to load the requested class: ".$class);
        }
    }
Basically it is a copy of Library and _ci_load_class but with the controller directory. This means controllers I can call the controller with $this->load->Controller('Controller_filename') then $this->controller_name->function(). However, when these 'sub' controllers try to use models or helpers they fail.
For example, If the controller I access uses a model I get the following message.
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Form_Model::$db

Filename: models/form_model.php

Line Number: 21

Could anybody help me get this working or help me understand why it is failing?


  Fatal error: Allowed memory size...
Posted by: El Forum - 06-27-2007, 11:39 PM - No Replies

[eluser]leon_dewey[/eluser]
Having a memory limit problem,

Their shouldnt be a problem as i incressed the limit to 200megs.... ( i know its over kill )


Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 112108305 bytes) in /data/********/httpdocs/survey/system/libraries/Parser.php on line 146


Any one have any ideas why this would happen?


  gmt_to_local() returns incorrect date
Posted by: El Forum - 06-27-2007, 11:37 PM - No Replies

[eluser]the real rlee[/eluser]
Hi guys,

I'm having weird issue with the date helper in CI. gmt_to_local() with correct timezone (UP10) is not showing the correct date, however PHP's gmdate IS showing the correct date.

What's possibly wrong here?

FYI Im using XAMPP on my local machine


  noob question
Posted by: El Forum - 06-27-2007, 10:06 PM - No Replies

[eluser]jstrebel[/eluser]
Hey there.. noob here.

I am trying to build a 3 level deep url loading a view at each stage.


My controllor for a user dashboard: dash.php

Code:
function index() {
                $data = array(
                        'morecontent' => '',
                );

                $content = $this->load->view('dash/index',$data,true);
                $this->wrapOutput($content,"Dashboard","dash");
        }
This gives me http://somesite.com/dash

So there is sub section of the dashboard called the account settings

Code:
function settings() {
                
                $data = array(
                        'morecontent' => $this->load->view('dash/settings',array(),true),
                        
                      
                );

                $content = $this->load->view('dash/index',$data,true);
                $this->wrapOutput($content,"Dashboard > Settings","dash");
        }
So above I am loading the settings view into the dash view... and it gives me http://somesite.com/dash/settings

So I want to now load a payment view into settings.. and have the final url be http://somesite.com/dash/settings/payment

My instinct is to create a function called payment() inside of the settings() function.. sort of like nesting folders in a file strcture... but that is not how CI works.

I need to have 3 or 4 subpages inside of settings, that is inside of dash... How best to accomplish this?

Sorry if it does not make sense.. I am thinking like a file system.. if I want to group pages into categories I just nest the file structure... how does one nest functions in a controllor to created nested url's?

It is important for us to use this 3 level structure as /dash will have many 2nd level pages which in turn have more 3rd level pages. like /dash/profile/bio and /dash/profile/privacy etc.


  Validation problem, maybe server problem
Posted by: El Forum - 06-27-2007, 09:32 PM - No Replies

[eluser]Référencement Google[/eluser]
Hi,

I get a problem with a simple form to validate.
In local it's perfectly working, but once on the prod server, impossible to make it work.

In my view form i have things like:

Code:
&lt;?=$this->validation->prenom_error?&gt;

And once on the production server, i get errors like :

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: prenom_error

Filename: contact_form/contact_form.php

Line Number: 8

Can somebody help me ?


  How to call functions of another controller
Posted by: El Forum - 06-27-2007, 08:33 PM - No Replies

[eluser]yongkhun[/eluser]
Is there a way to call the functions of another controller from a different controller? I try to do like $this->another_controller->function1() but error said "calling function on non-object". How? Thanks!


  Is this correct way...
Posted by: El Forum - 06-27-2007, 03:25 PM - No Replies

[eluser]mk3[/eluser]
I found solution. how to include in every page login form, but do not really know if it is correct. the method I used is I auto loaded library. and the library constructor is doing the following:

Code:
class Authorize {
    
    //constructor    
    function Authorize(){
        $this->CI =& get_instance();
        $this->CI->load->library('MySmarty');
        $this->CI->load->library('session');
        $this->CI->mysmarty->assign('login_errors', null);
        $this->CI->mysmarty->assign('user', $this->CI->session->userdata('user_data'));
        $this->CI->mysmarty->assign('logged_in', $this->CI->session->userdata('logged_in'));
        if (isset( $_POST['submit']) && $_POST['submit'] == 'Login'){
            $this->login();    
        }
    }

So when login form is submitted authorize library calls function which then processes login.

What it is interesting for me am I doing the right way. It seems OK for me, but I believe there are/can be some issues why this cannot be done.

Also would be nice to hear suggestions and critics.


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

Username
  

Password
  





Latest Threads
Running Codeigniter Queue
by warcooft
1 hour ago
CLI Error
by ltarrant
1 hour ago
Get folder path instead o...
by pippuccio76
4 hours ago
Codeignighter not resondi...
by mikehoague
4 hours ago
Where can I find a reliab...
by InsiteFX
10 hours ago
Myth Auth register a new ...
by InsiteFX
10 hours ago
Does CodeIgniter Shield H...
by tarcisiodev1
11 hours ago
Caching Question
by ozornick
Yesterday, 08:26 AM
Codeigniter and ReactJS
by murugappan
Yesterday, 01:18 AM
C4 Latest version shield ...
by kenjis
05-18-2024, 04:41 PM

Forum Statistics
» Members: 88,279
» Latest member: king88ngo1
» Forum threads: 77,670
» Forum posts: 376,483

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB