ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Modular Extensions - HMVC version 5.4

January 29, 2011 1:58am

Subscribe [99]
  • #196 / Dec 08, 2011 5:31am

    osci

    377 posts

    require dirname(__FILE__).'/Auth.php';
    class Auth_custom extends Auth {
    .....
  • #197 / Dec 14, 2011 3:06am

    Dan Storm

    70 posts

    Hi wiredesignz,

    I found this on SO, which might be a bug - I wasn’t able to reproduce it, but maybe someone else is?
    http://stackoverflow.com/questions/8487494/codeigniter-2-1-0-and-modular-extension-hmvc-database-error-randomly

  • #198 / Dec 14, 2011 3:24am

    wiredesignz

    2882 posts

    Although that error occurs in the MX_Loader::database() method the code there is functionally identical to the code in the CI_Loader::database() method provided with CodeIgniter 2.1.0

    I cannot duplicate this error either so I suspect the problem lies with his server or MySQL installation.

  • #199 / Dec 14, 2011 3:28am

    Dan Storm

    70 posts

    If the problem is with his server it would also explain why I can’t reproduce the problem.

    I linked to this thread on his question - he’d might be able to provide with additional information if he still has problems.

  • #200 / Dec 14, 2011 3:48am

    wiredesignz

    2882 posts

    Apparently this is not a new problem. A bit of research found another person having the same issue with his Mac and MySQL.

    http://stackoverflow.com/questions/6324467/trouble-with-hmvc-modular-extensions-for-codeigniter

  • #201 / Dec 14, 2011 3:53am

    Dan Storm

    70 posts

    My Google-fu must be weak; I tried finding similar problems, but I’m glad you found it. I Linked the post into his question - that might help him out.

  • #202 / Dec 14, 2011 11:36pm

    Keat Liang

    29 posts

    i found out HMVC does not work with multiple view path

    this is MY_Loader 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 {
        
         /**
         * Since _ci_view_paths is protected we use
         * this setter to allow things like plugins to
         * set a view location
         */
        public function set_view_path($path)
        {
            if (is_array($path))
            {
                // if we're restoring saved paths we'll do them all
                $this->_ci_view_paths = $path;
            }
            else
            {
                // otherwise we'll just add the specified one
                $this->_ci_view_paths = array($path => TRUE);
            }
        }
    
        /**
         * Since _ci_view_paths is protected we use
         * this to retrieve them.
         */
        public function get_view_paths()
        {
            // return the full array of paths
            return $this->_ci_view_paths;
        }
    }


    and my directory structure

    application/views
    application/controllers
    ...
    ...
    assets/theme/views
    assets/theme/views/layouts
    assets/theme/views/partials
    assets/theme/views/partials/something.php


    so at controller i do this

    //SET ADDITIONAL VIEW PATH
            $this->load->set_view_path(
                    array_merge(
                            $this->load->get_view_paths(), 
                            'assets/theme/views/' => TRUE)));

    so i that i can load view not just from application/views and application/modules/views

    and also i can load from custom path…..

     

    i tried

    $this->load->view('partials/something');


    and i get view not found ......
    and ideas to make it work ?

  • #203 / Dec 15, 2011 4:32am

    wiredesignz

    2882 posts

    @Keat Liang, I have pushed an update to Bitbucket which should allow you to use the cascading views feature.

  • #204 / Dec 15, 2011 4:55am

    Keat Liang

    29 posts

    @Keat Liang, I have pushed an update to Bitbucket which should allow you to use the cascading views feature.

    i found some issue, when

    $this->load->view('partials/something');

    suppose like this under Loader

    assets/themes/admin/views/partials/notice.php

    but it eats away ‘partials’

    assets/themes/admin/views/notice.php

    thanks for the fix BTW..

    workaround is specify multiple file path….

    assets/themes/admin/views/
    assets/themes/admin/views/partials/
  • #205 / Dec 15, 2011 5:23am

    wiredesignz

    2882 posts

    @Keat Liang, I have pushed an update to Bitbucket to prevent the sub-directory being removed from the path. Thanks.

  • #206 / Dec 15, 2011 5:42am

    Keat Liang

    29 posts

    @Keat Liang, I have pushed an update to Bitbucket to prevent the sub-directory being removed from the path. Thanks.

    thanks, now it work like a charm !, now i understand a little bit more HMVC code….

  • #207 / Dec 21, 2011 12:01am

    willaser

    7 posts

    Hello there, I was trying to implement HMVC 5.4 on CI 2.1.0. Several months ago I did it with HMVC 5.4 and CI 2.0.2 or 2.0.3. I have been following the installation guide from the wiki on bitbucket but it doesn’t work. What can I do to use HMVC on CI 2.1.0? Thanks in advance.

  • #208 / Jan 10, 2012 1:04am

    mak.gnu

    10 posts

    I’m using Codeigniter 2.1.0 and latest HMVC library from bitbucket

    On my development ubuntu machine code works withut any problem, but when I try to run the same code in windows machine views are not being loaded.
    I’m also using .(JavaScript must be enabled to view this email address) library.

    Default controllers and views works without any problem, but views in Module directory is not showing up.

    modules  
     -- home  
        --controllers  
        ----home.php
        --views
        ----home.php

    I tried using $this->load->views(‘home/home’); and $this->load->views(‘home’);

    but none of them worked.

  • #209 / Jan 10, 2012 10:31pm

    I looked around but didn’t see anyone address multiple folders in the controller? Like this…

    /accounts/account/welcome.php
    /accounts/account/files.php
    /accounts/account/projects.php
    /accounts/account/invoices.php

    Looks to me that I’d just need to update Router.php… this is the default:

    list($module, $directory, $controller) = array_pad($segments, 3, NULL);

    So I’d just need to run a few loops over the segments to see what is really a directory and what is really a controller.

    Should I build that out or am I missing something that is already written?

  • #210 / Jan 17, 2012 3:38pm

    harringr

    1 posts

    Looks to me that I’d just need to update Router.php… this is the default:

    list($module, $directory, $controller) = array_pad($segments, 3, NULL);

    So I’d just need to run a few loops over the segments to see what is really a directory and what is really a controller.

     

    Hi, I had a look at this before Christmas and thought that the looping/conditional-checks you described was probably the way to go.  I’d be interested to see how you get on - it would be a really great addition to the HMVC implementation!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases