nicksagona on 5.3.2
nicksagona on 4.5.11
nicksagona on 4.5.11
nicksagona on master
Patch expression issue for NOT … (compare)
nicksagona on v5-dev
Patch expression issue for NOT … (compare)
nicksagona on 3.7.1
nicksagona on master
Patch PHP 8 issue with named pa… (compare)
nicksagona on v3-dev
Patch PHP 8 issue with named pa… (compare)
nicksagona on 4.5.10
nicksagona on 4.5.10
nicksagona on v4-dev
Patch dirty save (compare)
nicksagona on master
Patch dirty save/set function (compare)
nicksagona on v5-dev
Patch dirty save/set function (compare)
nicksagona on 3.6.1
nicksagona on master
Patch setValue issue with Check… (compare)
nicksagona on v3-dev
Patch setValue issue with Check… (compare)
composer create-project -s beta popphp/popphp-framework project-folder
pop-pdf
Pop\Http\Request
and Pop\Http\Response
) vs the client classes are down in the Pop\Http\Client
namespace like Pop\Http\Client\Request
and Pop\Http\Client\Response
Pop\Http\Server\Request
and Pop\Http\Server\Response
pop-http
is complete... not live yet... I haven't cut a release yet. If anyone wants to look it over, you can do so over on the v4-dev branch here: https://github.com/popphp/pop-http/tree/v4-dev
pop-http
v4. I believe BC breaks have been kept to a minimum and the main thing that will have to change is any references to Pop\Http\Request
and Pop\Http\Response
will have to change to Pop\Http\Server\Request
and Pop\Http\Server\Response
, respectively
pop-kettle
, make sure you have v1.3.0 which now comes with the proper updates to the underlying templates to utilize pop-http
v4.
class Movies extends Pop\Db\Record
{
public function qualities()
{
return $this->hasMany('Qualities', 'movie_id'); // 'movie_id' is the FK
}
}
class Qualities extends Pop\Db\Record
{
public function movie()
{
return $this->belongsTo('Movies', 'id'); // 'id' is the primary key that is used to get the parent relationship
}
}
// Movie
Array
(
[id] => 1
[title] => Avengers
)
// Qualities of the movie
Array
(
[0] => Array
(
[id] => 1
[movie_id] => 1
[type] => Great
)
[1] => Array
(
[id] => 2
[movie_id] => 1
[type] => Exciting
)
)
$quality = Qualities::findById(1); // Get a single quality
$parentMovie = $quality->movie(); // Get that quality's parent movie
print_r($quality->toArray());
print_r($movie->toArray());
// Quality
Array
(
[id] => 1
[movie_id] => 1
[type] => Great
)
// Movie the quality belongs to
Array
(
[id] => 1
[title] => Avengers
)
movies
and a table qualities
with a FK qualities
.movie_id
referencing back to movies
.id
Thank you, Mr. Nick Sagona, for answering my question quickly. However, I don't think that's what I wanted to ask.
For example, in Laravel, a route is defined as follows:
Route::get('user/{id}/profile', function ($id) {
//
})->name('profile');
and to generate the url address (for href in <a>) the code is used:
$url = route('profile', ['id' => 1, 'photos' => 'yes']);
// /user/1/profile?photos=yes
Can something similar be done in popphp ?
/users/:id
or /users[/:id]