Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.2

[eluser]carmencito[/eluser]
thanks wiredesignz for your ME. I'm a new fan of CI and was impressed to have found your Modular Extensions.

One thing though, is the old version of ME (4.2) compatible with PHP 4? I have used your ME5.1 on my personal site, which is under development and hopefully we can use your Modular Extension on our current project which is run on PHP 4 server. Can somebody help to make ME compatible with PHP4? That would be nice if it'll be accomplished...

[eluser]Gnative[/eluser]
Has anyone found a solution to form_validation not working correctly with ME ? I'm stumped.. been trying to figure it out for a few days now.
There is a bug report in the bug tracker ad a few comment propping up in the forums

http://codeigniter.com/bug_tracker/bug/5708/

[eluser]wiredesignz[/eluser]
Before you go posting CodeIgniter bug reports have you tested that your code fails to work without ME installed?

[eluser]Gnative[/eluser]
wasn't me that posted the report.. and yes it does work without ME...

[eluser]wiredesignz[/eluser]
[quote author="Gnative" date="1225293130"]yes it does work without ME...[/quote]
So posting a CI bug report is actually pointless.

Could you show your code please, I may be able to help.

[eluser]Gnative[/eluser]
OK .. Thanks.. the issue is no errors or set_values are being returned in the case of validation failed, through form_helper i guess. Seems that the object in method _get_validation_object in CI's form_helper (line 950) is returning a string rather than an object.. this seems to be related to ME controller thou i cant seem to figure out anything passed this.. This issue has been noted in a few different forum post here.

Tested this against CI 1.7 and CI SVN

Below is a simple login of the code... validation does takes place correctly and as you can see nothing complicated here.

In auth controller ME Module

Code:
function login ()
        {
            
            //
            $this->load->library('form_validation');
            $this->load->helper( array('form', 'url') );
            
            // set rules
            $rules = array(
                            array(
                                    'field'=>'email',
                                    'label'=>'Email',
                                    'rules'=>'trim|required|valid_email'
                                ),
                            array(
                                    'field'=>'password',
                                    'label'=>'Password',
                                    'rules'=>'trim|required'
                                )
                            );
                            
            
            $this->form_validation->set_rules($rules);
            $this->form_validation->set_error_delimiters('<p class="error">', '</p>'); // Set the the error tags.
            
            
            //        
            if( $this->form_validation->run() === FALSE ) // Validation Failed
            {
                return $this->load->view('form_login');                
            }
            else // Validation Passed
            {
                // check login via red_auth
                $login = $this->redux_auth->login
                (
                    $this->input->post('email'),
                    $this->input->post('password')
                );                
                
                // if login redirect                
                if($login === TRUE)
                {
                    // updat euser status
                    $this->auth_library->update_user_stats( );
                    redirect('','location');
                }    
                else // not logged in .. probibly login false show login form
                    return $this->load->view('form_login');
                
            }
            
        }


and the view in module auth/view

Code:
<div class="login">
    &lt;?php echo form_open('auth/login',array('id'=>'login_form', 'class'=>'horizontal')) ?&gt;
        
        &lt;?php echo validation_errors(); ?&gt;
        
        <div class="row">
            <label for="email">Email:</label>
            &lt;?php echo form_error('email'); ?&gt;
            &lt;input type="text" name="email" id="email" class="text" value="&lt;?php echo set_value('email'); ?&gt;" /&gt;            
            <small>Enter your email address</small>
        </div>
        
        <div class="row">
            <label for="password">Password:</label>
            &lt;?php echo form_error('password'); ?&gt;
            &lt;input type="password" name="password" id="password" class="text" value="&lt;?php echo set_value('password'); ?&gt;" /&gt;
            <small>Enter your password</small>
    
        </div>
        
    &lt;?php echo form_close(); ?&gt;
</div>


Thanks

[eluser]Gnative[/eluser]
Sorry just to mention this is using ME 5.1.35

[eluser]wiredesignz[/eluser]
Modular Extensions 5.1.36 is available on the wiki.

Updated ME library loader to match CI 1.7 release. (fixes the form_validation issue mentioned above)

Module files can now be loaded from sub-directories. However cross loading module files is deprecated.

Code:
$this->load->library('subdir/some_lib'); // modules/{$module}/libraries/subdir/some_lib.php

[eluser]Gnative[/eluser]
oh your a legend...

[eluser]dexcell[/eluser]
[quote author="wiredesignz" date="1225297764"]Modular Extensions 5.1.36 is available on the wiki.

Updated ME library loader to match CI 1.7 release. (fixes the form_validation issue mentioned above)

Module files can now be loaded from sub-directories. However cross loading module files is deprecated.

Code:
$this->load->library('subdir/some_lib'); // modules/{$module}/libraries/subdir/some_lib.php
[/quote]

Thank you for putting it in the wiki.
I'm gonna try this ME library after i'm going home later.

Just a little question, if i want to autoload some config in the module, how can i accomplish this?

in Matchbox it's looklike this

Code:
$autoload['config'] = array('module_name' => 'config_name');




Theme © iAndrew 2016 - Forum software by © MyBB