Skip to content

Instantly share code, notes, and snippets.

@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@SimonPadbury
SimonPadbury / hovernav.css
Last active April 4, 2019 00:29
This is a simple supplement for Bootstrap 3 to transform the navbar so that the dropdown menu appears on hover instead of on click. No need to modify the Bootstrap 3 js or css at all – simply add this js and css below to your js and css files that are <head> linked *after* the Bootstrap 3 js and css files. Styles for both .navbar-default and .na…
/*
Navbar "hovernav" dropdown menu - this works only for screen sizes larger than phones.
The Bootstrap CSS is unchanged.
*/
@media (min-width: 768px) {
.navbar-nav .open ul {
display: none;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
@langhard
langhard / ext_tables.php
Created July 15, 2013 08:21
TYPO3-CMS - FAL - TCA
'tx_famoca_navigation_image' => array(
'exclude' => 0,
'label' => 'LLL:EXT:famoca/Resources/Private/Language/locallang_db.xlf:tx_famoca_domain_model_page.navigation_image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('tx_famoca_navigation_image',
array(
'appearance' => array(
'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference',
'collapseAll' => TRUE,
),
'maxitems' => 1,
@josefglatz
josefglatz / TYPO3CMS TypoScript Keyvisual
Last active December 17, 2015 05:38
Task: have all images from pages media field listed in TypoScript, for example to use in a slideshow. (Compatible only with >= TYPO3 6-0)
## list images from pages:media in TypoScript using FAL and crop it automatically
lib.View.Keyvisual = FILES
lib.View.Keyvisual {
references {
data = levelmedia:-1, slide
}
renderObj = COA
renderObj {
10 = IMAGE