PHP code example of axis / axis-curly-routing-plugin
1. Go to this page and download the library: Download axis/axis-curly-routing-plugin 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/ */
class blogActions extends sfActions
{
public function executeShowPost($request)
{
$post = $this->getRoute()->getObject('post');
}
}
show_product:
url: /shop/{category.path}/{product.slug}-{product.id}.html
param: { ... }
class: CurlyObjectRoute
options:
transform:
product:
model: Product
query_methods: [ filterPublished, filterInStock ]
# or you can use short syntax if there is only model option for a namespace
category: Category