background preloader

Symfony2 cheat sheet

Symfony2 cheat sheet

Twig : Les filtres disponibles - Alexandre Clain Autant vous le dire tout de suite, je suis tombé littéralement amoureux de Symfony 2. Pratiquant incontesté du MVC et des bonnes pratiques de programmation, je prends particulièrement soin d’utiliser la puissance d’un moteur de template pour bien séparer le code HTML du PHP. Voici un aide mémoire sur la liste de tous les filtres qui sont disponible sous Twig, en espérant que cet anti-séche vous servira autant qu’à moi. Retourner une valeur absolue : abs() Permet de s’assurer d’avoir l’affichage d’une valeur positive sur sa vue. Formater une chaîne pour mettre le premier caractère en capitale : capitalize() Ce filtre peut être utile quand vous voulez absolument que la chaîne de caractère commence par une lettre en capitale. Modifier l’encodage par un un autre : convert_encoding() Si vous récupérer une chaîne de caractère avec le mauvais encodage vous pourrez directement modifier cela dans la vue. Formater l’affichage d’une date : date() Modifier la valeur d’une date : date_modify()

DDD with Symfony2: Folder Structure And Code First | William DURAND 2013-08-11 - Move JMSSerializerBundle configuration files into the ApiBundle bundle. Domain Driven Design also known as DDD is an approach to develop software for complex needs by connecting the implementation to an evolving model. It is a way of thinking and a set of priorities, aimed at accelerating software projects that have to deal with complicated domains. It is possible to use this approach in a Symfony2 project, and that is what I am going to introduce in a series of blog posts. Bootstrap¶ Start by creating a fresh project using the symfony-standard edition: composer create-project symfony/framework-standard-edition path/to/install I use to remove unecessary files such as src/*, as well as useless bundles. Don't forget to update the AppKernel class accordingly. Folder Structure¶ As Mathias Verraes stated in his blog post about Code Folder Structures, most of the usual Symfony2 project folder structures are not efficient. In your case, the domain expert said users are centrepieces. <?

NDP Software :: Git Cheatsheet stash workspace index local repository upstream repository status Displays: <br>• paths that have differences between the index file and the current <code>HEAD</code> commit, <br>• paths that have differences between the workspace and the index file, and <br>• paths in the workspace that are not tracked by git. diff Displays the differences not added to the index. diff commit or branch View the changes you have in your workspace relative to the named <em>commit</em>. add file... or dir... Adds the current content of new or modified files to the index, thus staging that content for inclusion in the next commit. add -u Adds the current content of modified (NOT NEW) files to the index. rm file(s)... Remove a file from the workspace and the index. mv file(s)... Move file in the workspace and the index. commit -a -m 'msg' Commit all files changed since your last commit, except untracked files (ie. all files that are already listed in the index). checkout files(s)... or dir reset HEAD file(s)... reset --hard

EmanueleMinotto/awesome-symfony2 · GitHub Collecting all the cheat sheets

Related: