Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
from micromvc.
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)
- PHPUnit
- Bug in ORM.php HOT 1
- How to: Form Validation HOT 2
- Installing micro/micro error! HOT 2
- too many installation problems HOT 1
- About Locale.php
- Tag releases request
- Cannot load css file HOT 2
- Error ID: Issue
- Where not equal HOT 2
- Getting Page not Found HOT 1
- Deprecated iconv_set_encoding in PHP 5.6 HOT 2
- About localization
- PHP 5.3 -> PHP 5.5
- How to write another default method in Controller and access via Route HOT 3
- How to write hook
- has development stopped on micromvc? HOT 1
- multiple database connections?
- PHP7 + MicroMVC
- The domain `micromvc.com` is already lost? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micromvc.