xeoncross / 1kb-php-mvc-framework Goto Github PK
View Code? Open in Web Editor NEWModel, View, Controller framework with URL routing, PDO database, and ORM each in 1kb!
License: MIT License
Model, View, Controller framework with URL routing, PDO database, and ORM each in 1kb!
License: MIT License
I've been playing again with this system which I really enjoy.
Now there's one thing, I've got three tables
Users: user_id
Groups: group_id
Groups_Users: id, group_id, user_id
I'm trying to get user information using this relation.
$groups = new Groups();
foreach($groups->get() as $group):
echo $group->user->name;
endforeach();
The results I get its the information from Groups_Users but not from Users. How would you do this? ( I don't know if this makes any sense to you )
I understand you are trying to fit your code into 1kb .. but it's impossible to read or follow -- besides php's libraries does not have restrictions such as css or js libraries; where the file size really matters.
--- Update:
ok, nevermind, I just saw the "last updated 3 years ago" :)
Using ORM how is possible to do where conditions? Would like to join OR and AND but from what I see from the where function it only works with AND.
I have a class Users that extends ORM and I can't seem to get to $user->fetch() or $user->query().
I'm playing around with the system but it looks like that I can't use db(c('db')) or $db->fetch($sql) in a model and if I extend ORM with Model_User it doesn't do anything. When using model, db is not loaded neither ORM. Did I miss anything or is it a bug?
P.S - Closed. Problem was mine. Loading wrong model.
do you have also an unminified version of this code?
test.php
<?php
echo 'REQUEST_URI';
echo getenv('REQUEST_URI');
php -S localhost:88
curl htttp://localhost:88/aa/bbb
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.