CodeIgniter Forums
using grocery crud with wiredesignz codeigniter modular extensions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: using grocery crud with wiredesignz codeigniter modular extensions (/showthread.php?tid=40729)



using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 04-17-2011

[eluser]Unknown[/eluser]
To use the two together have made ​​the following changes

MY_Loader in grocery
Defualt:
Code:
<?php

class MY_Loader extends CI_Loader {

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

/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader {

AND
grocery_crud.php Line 1184
Default:
Code:
private function _theme_view($view, $vars = array(), $return = FALSE)
    {
        $ci = &get;_instance();
        $orig_view_path = $ci->load->_ci_view_path;
        $ci->load->_ci_view_path = $this->theme_path.$this->theme.'/';
        
        if($return)
        {
            $return_view = $ci->load->view($view,$vars,true);
            $ci->load->_ci_view_path = $orig_view_path;
            return $return_view;
        }
        else
        {
            $ci->load->view($view,$vars);
            $ci->load->_ci_view_path = $orig_view_path;
        }
    }

Changed:
Code:
private function _theme_view($view, $vars = array(), $return = FALSE)
    {
        $ci = &get;_instance();
        $orig_view_path = $ci->load->_ci_view_path;
        $ci->load->_ci_view_path = $this->theme_path.$this->theme.'/';
        
        if($return)
        {
            $return_view = $ci->load->view($view,$vars,TRUE,TRUE);
            $ci->load->_ci_view_path = $orig_view_path;
            return $return_view;
        }
        else
        {
            $ci->load->view($view,$vars,FALSE,TRUE);
            $ci->load->_ci_view_path = $orig_view_path;
        }
    }
And
loader.php in third_party\MX Line 251
Default:
Code:
/** Load a module view **/
    public function view($view, $vars = array(), $return = FALSE) {
        list($path, $view) = Modules::find($view, $this->_module, 'views/');
        $this->_ci_view_path = $path;
        return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
    }

Changed:
Code:
/** Load a module view **/
    public function view($view, $vars = array(), $return = FALSE,$Default = FALSE) {
        if($Default)
        {
            return parent::view($view,$vars,$return);
        }
        list($path, $view) = Modules::find($view, $this->_module, 'views/');
        $this->_ci_view_path = $path;
        return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
    }

other solutions?

sorry for my bad english Sad


using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 05-03-2011

[eluser]mattex123[/eluser]
Thanks for the share sajjad. But I get an error when trying to load one of the example templates.

Code:
An Error Was Encountered
The template does not exist...

You dont get this?

I'll post here if I find a solution.


EDIT: Problem was the path of the template files. Make sure your paths are set right, and remember to ignore the relevant files if you use rewrite rules.

Again thanks sajjad!


using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 05-03-2011

[eluser]web-johnny[/eluser]
Thanks Sajjad. This post will help users that work with grocery CRUD and HMVC


using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 08-13-2011

[eluser]Unknown[/eluser]
finally i found it Big Grin

thanks sajjad


using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 09-23-2014

[eluser]Unknown[/eluser]
Hi!

First of all, sorry for posting in such an old thread.

Im working on a site made with CodeIgniter 2.0.2 with HMVC.

I have been trying to add GroceryCrud to it but so far I haven't been able to do so.

Do you have an update on how to make it work? I have followed your instructions but they dont seem to work with CI 2.0.2.


Thanks in advance.

Knox


using grocery crud with wiredesignz codeigniter modular extensions - El Forum - 09-24-2014

[eluser]InsiteFX[/eluser]
You should upgrade to CI 2.2.0