• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Callback problem with HMVC

#1
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
IgnitedCMS Pro
IgnitedCMS
Practical guide to IgnitedCMS - Book coming soon
Reply

#3
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 the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#4
(03-04-2017, 06: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 the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#6
DID YOU TRY IT IN CODEIGNITER 3.1.3?
Reply

#7
the solution of InsiteFX works well!!
thanks!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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