Welcome Guest, Not a member yet? Register   Sign In
[split] Callback problem with HMVC
#1

(This post was last modified: 03-04-2017, 03:04 AM by ciadmin.)

Callback doesn't work with codeigniter 3.1.3 HMVC, using the previous version's My_Form_validation method!!
What is the solution for this?!
Is there an additional line of code that may be changed to make this work correctly ?
Reply
#2

http://www.catb.org/esr/faqs/smart-questions.html
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply
#3

(This post was last modified: 03-04-2017, 10:57 AM by InsiteFX. Edit Reason: Missing $CI added )

Because you need to extend the Form_validation library.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

/**
 * ----------------------------------------------------------------------------
 * Editor   : PhpStorm 2016.3.2
 * Date     : 01/05/2017
 * Time     : 6:29 AM
 * Authors  : Raymond L King Sr.
 * ----------------------------------------------------------------------------
 *
 * Class        MY_Form_validation
 *
 * @project     CI
 * @author      Raymond L King Sr.
 * @link        http://www.procoversfx.com
 * @copyright   Copyright (c) 2009 - 2017 Pro Covers FX, LLC.
 * @license     http://www.procoversfx.com/license
 * ----------------------------------------------------------------------------
 */

/**
 * Class MY_Form_validation
 *
 * Wiredesignz - Modular Extensions HMVC
 * 
 * USEAGE:
 *
 * if ($this->form_validation->run($this) == FALSE)
 * {
 *
 * }
 * else
 * {
 *
 * }
 */
class MY_Form_validation extends CI_Form_validation
{

    
/**
     * Class properties - public, private, protected and static.
     * ------------------------------------------------------------------------
     */

        
protected $CI;

    
// ------------------------------------------------------------------------

    /**
     * run ()
     * ---------------------------------------------------------------------------
     *
     * @param   string $module
     * @param   string $group
     * @return  bool
     */
    
public function run($module ''$group '')
    {
        (
is_object($module)) AND $this->CI = &$module;

        return 
parent::run($group);
    }

    
// ------------------------------------------------------------------------

  // End of MY_Form_validation Class.

/**
 * ----------------------------------------------------------------------------
 * Filename: MY_Form_validation.php
 * Location: ./application/libraries/MY_Form_validation.php
 * ----------------------------------------------------------------------------
 */ 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(03-04-2017, 05:15 AM)InsiteFX Wrote: Because you need to extend the Form_validation library.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

/**
 * ----------------------------------------------------------------------------
 * Editor   : PhpStorm 2016.3.2
 * Date     : 01/05/2017
 * Time     : 6:29 AM
 * Authors  : Raymond L King Sr.
 * ----------------------------------------------------------------------------
 *
 * Class        MY_Form_validation
 *
 * @project     CI
 * @author      Raymond L King Sr.
 * @link        http://www.procoversfx.com
 * @copyright   Copyright (c) 2009 - 2017 Pro Covers FX, LLC.
 * @license     http://www.procoversfx.com/license
 * ----------------------------------------------------------------------------
 */

/**
 * Class MY_Form_validation
 *
 * Wiredesignz - Modular Extensions HMVC
 * 
 * USEAGE:
 *
 * if ($this->form_validation->run($this) == FALSE)
 * {
 *
 * }
 * else
 * {
 *
 * }
 */
class MY_Form_validation extends CI_Form_validation
{

    
/**
     * Class properties - public, private, protected and static.
     * ------------------------------------------------------------------------
     */


    // ------------------------------------------------------------------------

    /**
     * run ()
     * ---------------------------------------------------------------------------
     *
     * @param   string $module
     * @param   string $group
     * @return  bool
     */
    
public function run($module ''$group '')
    {
        (
is_object($module)) AND $this->CI = &$module;

        return 
parent::run($group);
    }

    
// ------------------------------------------------------------------------

  // End of MY_Form_validation Class.

/**
 * ----------------------------------------------------------------------------
 * Filename: MY_Form_validation.php
 * Location: ./application/libraries/MY_Form_validation.php
 * ----------------------------------------------------------------------------
 */ 
Does this work with codeIgniter 3 with HMVC?
I use this one for codeIgniter 3 and it's working with codeIgniter 3.1.3 except the collback that returns an error
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation{

    public $CI;
}
Reply
#5

Yes it doe's.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

DID YOU TRY IT IN CODEIGNITER 3.1.3?
Reply
#7

the solution of InsiteFX works well!!
thanks!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB