Skip to content

Instantly share code, notes, and snippets.

@YuzuruSano
Last active February 10, 2016 11:48
Show Gist options
  • Save YuzuruSano/5a0b00b514854ab28b22 to your computer and use it in GitHub Desktop.
Save YuzuruSano/5a0b00b514854ab28b22 to your computer and use it in GitHub Desktop.
concrete5 5.7系 ajaxのアクセスポイントを作る
<?php
/* ===============================================
@application/bootstrap/app.php
//for ajax
/endpoint/fav/{page_id} にアクセスすると、
Application\Controller\FavクラスののsetFavoriteメソッドを実行
{page_id}は引数、この場合はページIDを渡して処理に使ったりとか
URLのルールとかできることはsymfonyのドキュメントとかで
=============================================== */
Route::register(
'/endpoint/fav/{page_id}',
'Application\Controller\Fav::setFavorite'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment