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

[eluser]Andy78[/eluser]
can you give me an example as I just don't know what I'm doing.

here is my login function in the auth controller its more or less straight out of ion_auth

can you show me a basic remap function that will redirect back to the partial view and display the form validation errors for the required fields for example?

Code:
//log the user in
    function login()
    {
        $this->data['title'] = "Login";
        
        
        //validate form input
        $this->form_validation->set_rules('username', 'Username', 'required');
        $this->form_validation->set_rules('password', 'Password', 'required');

        if ($this->form_validation->run() == true) { //check to see if the user is logging in
            //check for "remember me"
            if ($this->input->post('remember') == 1) {
                $remember = true;
            }
            else {
                $remember = false;
            }
            
            if ($this->ion_auth->login($this->input->post('username'), $this->input->post('password'), $remember)) { //if the login is successful
                //redirect them back to the home page
                $this->session->set_flashdata('message', $this->ion_auth->messages());
                redirect($this->config->item('base_url'), 'refresh');
            }
            else { //if the login was un-successful
                //redirect them back to the login page
                $this->session->set_flashdata('message', $this->ion_auth->errors());
                redirect('auth/login', 'refresh'); //use redirects instead of loading views for compatibility with MY_Controller libraries
            }
        }
        else {  //the user is not logging in so display the login page
            //set the flash data error message if there is one
            $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
            
            $this->data['username']      = array('name'    => 'username',
                                              'id'      => 'username',
                                              'type'    => 'text',
                                              'value'   => $this->form_validation->set_value('email'),
                                             );
            $this->data['password']   = array('name'    => 'password',
                                              'id'      => 'password',
                                              'type'    => 'password',
                                             );
            
            $this->load->view('auth/login', $this->data);
        }
    }

[eluser]cLin[/eluser]
Forgive me for this question but I just wanted to clarify, this addon is mainly used for people who want to create addition addons and make it easy for others to integrate into their programs? If so, I would need to install this if someone created an addon based off this right?

I was reading wikipedia and that was the gist of what I got from modular programming.

[eluser]gvillavizar[/eluser]
[quote author="cLin" date="1289366962"]Forgive me for this question but I just wanted to clarify, this addon is mainly used for people who want to create addition addons and make it easy for others to integrate into their programs? If so, I would need to install this if someone created an addon based off this right?

I was reading wikipedia and that was the gist of what I got from modular programming.[/quote]

Actually this plugin (if you want to call it that way) is a better way to handle applications in codeigniter as it offer a more portable way to manage settings and programming into any application.

Due to its mobility it is more commonly used on custom CMS, but here is an example of how you can use it. Suppose on one of your sites you use a blog, you work it as a module, then on other site you need to use the same blog, you just copy the blog folder from modules to your new CI installation and the blog is (if done right) fully usable on the new installation.

Understand?

[eluser]cLin[/eluser]
I see, that's what I was thinking about. But would I need to install on HMVC on both sites or would it be packaged into the blog (using your example).

Thanks for clarifying my question.

[eluser]Vheissu[/eluser]
Looks like the newly released build of Codeigniter 2.0 doesn't work with Modular Extensions. It looks like EllisLab have taken a surprising back-step and dropped support for PHP 4 completely by removing the compatibility file and base file as well.

I'm going to try and fix MX for my CMS, but it would be awesome if you could release an update to help everyone out. Looks like CI_Controller has been introduced too.

[eluser]wiredesignz[/eluser]
Yeah, I am working on an update as we speak.

I don't see why you would want to update CI just to break your application without waiting until MX is ready.

[eluser]wiredesignz[/eluser]
Modular Extensions HMVC v5.3.5 is available from Bitbucket.

Updated to remain compatible with CI 2.0, added support for CI_Controller.

[eluser]Boris Strahija[/eluser]
I'm having a problem since I updated to the latest CI2 version + latest HMVC version from BitBucket.

Controller:
Code:
class Krustr extends MX_Controller {
...
    public function __construct()
    {
        ...
        $this->load->library('KR_Router');
        ...
    }


So, pretty straightforward. But I'm getting this error:
Code:
ErrorException [ Notice ]: Undefined index: KR_Router
134     $_alias = $this->_ci_classes[$class];


Funny thing is that in the same constructor I load some libraries before KR_Router, and they work:
Code:
$this->load->library('option');
$this->load->library('textile');
$this->load->library('video_embed');
$this->load->library('authentication/auth');

[eluser]Boris Strahija[/eluser]
Looks like it's a problem with lowercase letters.
I changed Loader.php (line 134) from:
Code:
$_alias = $this->_ci_classes[$class];
to:
Code:
$_alias = $this->_ci_classes[strtolower($class)];

[eluser]VicToMeyeZR[/eluser]
AS found in your directions here : http://bitbucket.org/wiredesignz/codeign.../wiki/Home

I followed them to the tee for installation for CI 2.0

Fatal error: Class 'CI_Controller' not found in C:\wamp\www\BMS\application\third_party\MX\Ci.php on line 40


No code was changed nor added. Only from a CI 2.0 clean install.




Theme © iAndrew 2016 - Forum software by © MyBB