vitalyswipe / tinymvc Goto Github PK
View Code? Open in Web Editor NEWSimple MVC Site
Simple MVC Site
Скажите как было бы вернее написать в реальной жизни
if ( !empty($routes[2]) )
{
$action_name = $routes[2];
}
$action_name = 'action_'.$action_name;
или
if ( !empty($routes[2]) )
{
$action_name = 'action_'.$routes[2];
}
А так же
if(file_exists($model_path))
{
include "application/models/".$model_file;
}
или
if(file_exists($model_path))
{
include $model_path;
}
Прочитал вашу статью на Хабре и она очень многое насчет MVC мне расставила на места. Большое за нее спасибо. Только вот этот момент по написанию хотелось бы уточнить. Чтоб не учится писать неверно, если второй вариант не правильный с точки зрения каких-либо "стандартов".
Не происходит перенаправление на страницу admin/
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at V:\home\scripts\www\index.php:1) in V:\home\scripts\www\application\controllers\controller_login.php on line 24
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at V:\home\scripts\www\index.php:1) in V:\home\scripts\www\application\controllers\controller_login.php on line 24
Warning: Cannot modify header information - headers already sent by (output started at V:\home\scripts\www\index.php:1) in V:\home\scripts\www\application\controllers\controller_login.php on line 26
I would like to know how do I work the correct way I'm using mvc it's only working if it's in the example root folder
The structure will be like this
http://localhost/homologacao/services
http://localhost/homologacao/contato
Model: homologacao
Controller: homologacao
Action: action_index
Fatal error: Uncaught Error: Class 'homologacao' not found in /home/web/Downloads/web/homologacao/App/core/route.php:82 Stack trace: #0 /home/web/Downloads/web/homologacao/index.php(13): Route::start() #1 {main} thrown in /home/web/Downloads/web/homologacao/App/core/route.php on line 82
OBS : The way it would be would be simple if the folder is homologation it le this initial if it is another folder sample test would look like this
http://localhost/teste/services
http://localhost/teste/contato
Would you help me?
Thank you
Не работает в поддиректории к примеру http://scripts/tinymvc
Это похоже на то, что не отрабатывает страница 404
Warning: Cannot modify header information - headers already sent by (output started at V:\home\scripts\www\tinymvc\index.php:1) in V:\home\scripts\www\tinymvc\application\core\route.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at V:\home\scripts\www\tinymvc\index.php:1) in V:\home\scripts\www\tinymvc\application\core\route.php on line 89
Warning: Cannot modify header information - headers already sent by (output started at V:\home\scripts\www\tinymvc\index.php:1) in V:\home\scripts\www\tinymvc\application\core\route.php on line 90
Fatal error: Class 'Controller_Tinymvc' not found in V:\home\scripts\www\tinymvc\application\core\route.php on line 68
В чём дело?
Скачал, код и попробовал написать это простенький framework, не получается. Я не могу найти, за что отвечает атозаполнение .httachess
Собтвенно как вывести пост с условем where = 1 например, меня кидает на 404 роутер,создал модель, контроллер и представление для view
пытаюсь site.ru/view?id=1 , кидает на 404
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.