Code Monkey home page Code Monkey logo

Comments (6)

lonnieezell avatar lonnieezell commented on August 11, 2024

I have never tried using the HMVC, only Matchbox and Modular Separation. If it works the same way as those, and I believe it does, the change should be a simple one. And that change should only be needed if you are using the themes feature of Ocular.

In HMVC's MY_Loader file (I'm assuming it has one, that's how the others work....) check to see if it overrides the _ci_load() method. If it does, you will need to integrate a very small change that I implemented in that method that simply checks to see if Ocular is loaded and, if so, returns false when a view file is not found.

Ocular, itself, uses $this->load->view() exclusively to render views so that it would be as compatible as possible with third party HMVC-type plugins.

There may be more to it then that, I can't say. :) But that should theoretically be all that is needed. It all depends on how the HMVC library works.

I'd love to hear if you get it working and what changes you made to make that happen. If you want to fork the code and implement a change there, send a pull request and I'll include it in the official repo.

from ocular-template-library.

karellm avatar karellm commented on August 11, 2024

Thanks for the help. Ocular loads but it looks for the view at the wrong place :
Current View = ../modules/welcome/controllers/welcome/index
Instead of ../modules/welcome/views/welcome/index

The result is an error (header already sent by Template.php)

Do you have an idea?

from ocular-template-library.

lonnieezell avatar lonnieezell commented on August 11, 2024

I do have one idea, but it might cause a problem if you're using controllers within those modules that are in subfolders, like module/module_name/controllers/admin/controller.php. If you're not doing that, you can try the following fix:

On line 237 of the latest version, remove the directory call, so it should go from this:

$this->current_view = $this->ci->router->directory . $this->ci->router->class . '/' . $this->ci->router->method;

to this:

$this->current_view = $this->ci->router->class . '/' . $this->ci->router->method;

from ocular-template-library.

karellm avatar karellm commented on August 11, 2024

It didn't work, but I put (and it worked):
$this->current_view = '../views/' . $this->ci->router->class . '/' . $this->ci->router->method;

Is there a way to do it in a cleaner way though?

from ocular-template-library.

karellm avatar karellm commented on August 11, 2024

And why do you echo the view path? I don't get it and I don't see any config variable for dev/prod env that would turn it off. What is it made for?

Thank you for you help!

from ocular-template-library.

lonnieezell avatar lonnieezell commented on August 11, 2024

I'm not sure of a cleaner way to do it then what you have there. If it's working for this project, then great! :)

As for echoing the view path... my bad. I was trying to debug something and forgot to delete it before uploading. Feel free to rip it out of there.

from ocular-template-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.