enkhtulga / php-sample-blog Goto Github PK
View Code? Open in Web Editor NEWHow to build the sample blog via MVC
How to build the sample blog via MVC
Create new branch I6_delete_post
and add ability to delete a post.
Delete link would be /index.php/delete?id=<post_id>
.
Please create a Post
model that extends from Model
class.
And use this model throughout the site.
Here is the sample usage:
// add new post
$post = new Post();
$post->title = 'My new post';
$post->save();
// update existing post
$post = Post::getById($id);
$post->title = 'Fox and rabbit';
$post->save();
// delete existing post
$post = Post::getById($id);
$post->delete();
// get all posts
$posts = Post::getAll();
foreach ($posts as $post) {
echo $post->title;
}
Create new branch I5_edit_post
and add a feature that edits a post on a form which is accessed by /index.php/edit?id=<post_id>
Create a local_settings.php file and exclude in commits via .gitignore
.
So that local configs for developers won't conflict.
Create new git branch I4_create_new_post
and implement a feature that adds new post via /index.php/add/
URI.
Add new model, Author
.
Let there be an ability to manage authors, CRUD.
Authors should be able to login by typing their name and password.
Anyone who is logged in can manage authors and posts.
When post is added set post.author_id
as current author id.
Use command line tool to update the repo.
Configure your ssh key: https://github.com/settings/ssh. So that you won't have to type in your login info every time you push/pull.
Implement a .htaccess
file to forward all requests but static files to front controller (index.php).
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.