PHP code example of zadarkside / paris
1. Go to this page and download the library: Download zadarkside/paris library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zadarkside / paris example snippets
class User extends Model {
public function tweets() {
return $this->has_many('Tweet');
}
}
class Tweet extends Model {}
$user = Model::factory('User')
->where_equal('username', 'j4mie')
->find_one();
$user->first_name = 'Jamie';
$user->save();
$tweets = $user->tweets()->find_many();
foreach ($tweets as $tweet) {
echo $tweet->text;
}