Giter Site home page Giter Site logo

Comments (9)

xeoncross avatar xeoncross commented on July 20, 2024

As of right now there is a problem with placing the system in a subdirectory. The problem as you noticed is that the site_url() function does not check the config value. This should be fixed in the next iteration. For now you might need to change the site_url() function in the boostrap.php file.

function site_url($uri = NULL)
{
    return (strpos($uri,'://')===FALSE?DOMAIN.'/'.config('site_url'):'').$uri;
}

from micromvc.

johnroescher avatar johnroescher commented on July 20, 2024

That does work to make site_url() return the right domain/subdomain but it's still showing 404.

the 404 config works

$config['404'] = 'example/404';

by the line you see at the top of
http://tribedata.net/whb-dir/

but it's still not showing

$config['index'] = 'example/index';

from micromvc.

xeoncross avatar xeoncross commented on July 20, 2024

What have you altered? It's reporting the problem as being a missing "content" value which each controller is supposed to set ($this->content = ...) because it's called in the final layout.php view (print $content).

from micromvc.

johnroescher avatar johnroescher commented on July 20, 2024

Oh, those errors aren't related. layout.php isn't getting $content because I just replaced everything in the controller with the simple echo you see at the top to make sure it understood

$config['404'] = 'example/404';

I thought I might be doing something wrong there but I'm not.

from micromvc.

xeoncross avatar xeoncross commented on July 20, 2024

Just so we're clear, example/404 calls the Controller->show_404() which sends a 404 header and loads the 404.php view file. So you should be getting a 404 on that page. However, I manually added the sub directory to the path for the other pages (http://tribedata.net/whb-dir/example/form) and it seems to load fine. You probably need to edit the layout.php file and add that path to them also (since the I can see the CSS files aren't loading either because they are missing the subdirectory).

http://tribedata.net/theme/view/css/base.css
to
http://tribedata.net/whb-dir/theme/view/css/base.css

from micromvc.

johnroescher avatar johnroescher commented on July 20, 2024

I understand about the 404. I had altered that stuff to show my own 404 text to make sure it was working correctly, which is was.

If you load any of the subpage or the main page now, you'll see it is actually loading 404.

from micromvc.

xeoncross avatar xeoncross commented on July 20, 2024

The problem is the URL routing does not take the subdirectory into account when figuring out which controller to load. For example, given the URI whb-dir/example/form index.php is actually trying to load the class new Whb-dir_Controller_Example() and call the Form() method. I'll fix this in the next release.

I'm currently in the process of uncompressing all the code so it will be much easier to read. Checkout the "development" branch if you need to understand how something works.

from micromvc.

johnroescher avatar johnroescher commented on July 20, 2024

Hmm, loading in the development version gives me a white screen no matter what I do.

I'm working to go line by line and see where it's failing.

http://tribedata.net/whb-dir/

from micromvc.

xeoncross avatar xeoncross commented on July 20, 2024

I just noticed that your server is using PHP/5.2.9. MicroMVC is only built to work on PHP 5.3 and higher because of the use of late static binding and other new features. If you are running a Debian/Ubuntu server you can upgrade your PHP package using dotdeb or installing Debian 6. If you are on a shared host there is not much you can do but request PHP 5.3 to be installed.

from micromvc.

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.