\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Marcel Berteler (pluk77)} \pdfinfo{ /Title (symfony-5.pdf) /Creator (Cheatography) /Author (Marcel Berteler (pluk77)) /Subject (Symfony 5 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{DE7A09} \definecolor{LightBackground}{HTML}{FCF6EF} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Symfony 5 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Marcel Berteler (pluk77)} via \textcolor{DarkBackground}{\uline{cheatography.com/55947/cs/14851/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Marcel Berteler (pluk77) \\ \uline{cheatography.com/pluk77} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 18th April, 2023.\\ Updated 10th May, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4.8 cm} x{3.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Entity Manager in a controller}} \tn % Row 0 \SetRowColor{LightBackground} \$this-\textgreater{}getDoctrine()-\textgreater{}getManager(); & Get default entity manager \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \$this-\textgreater{}getDoctrine()-\textgreater{}getManagerForClass(MyEntity::class) & Get entity specific manager \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Repositories in a controller}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\$this-\textgreater{}getDoctrine()-\textgreater{}getRepository(MyEntity::class);} \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Doctrine Query}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{getResult}}(\$hydrationMode = \seqsplit{self::HYDRATE\_OBJECT)} & Retrieve a collection \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{getSingleResult}}(\$hydrationMode = null) & Retrieve a single result or exception \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{getOneOrNullResult}}(\$hydrationMode = null) & Retrieve a result or NULL \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} {\bf{getArrayResult}}() & Retrieve an array \tn % Row Count 10 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{getScalarResult}}() & Retrieves a flat/rectangular result set of scalar values \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} {\bf{getSingleScalarResult}}() & Retrieves a single scalar value or exception \tn % Row Count 16 (+ 3) % Row 6 \SetRowColor{LightBackground} \{\{bt\}\}AbstractQuery::HYDRATE\_OBJECT & \{\{bt\}\}Object graph {\bf{default}} \tn % Row Count 18 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{AbstractQuery::HYDRATE\_ARRAY} & Array graph \tn % Row Count 20 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{AbstractQuery::HYDRATE\_SCALAR} & Flat rectangular result with scalars \tn % Row Count 22 (+ 2) % Row 9 \SetRowColor{white} \seqsplit{AbstractQuery::HYDRATE\_SINGLE\_SCALAR} & Single scalar value \tn % Row Count 24 (+ 2) % Row 10 \SetRowColor{LightBackground} \seqsplit{AbstractQuery::HYDRATE\_SIMPLEOBJECT} & Very simple object {\bf{fast}} \tn % Row Count 26 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{{\bf{setCacheMode}}(\$cacheMode)} \tn % Row Count 27 (+ 1) % Row 12 \SetRowColor{LightBackground} \{\{bt\}\}Cache::MODE\_GET & \{\{bt\}\}may read, not write \tn % Row Count 29 (+ 2) % Row 13 \SetRowColor{white} Cache::MODE\_PUT & no read, write all \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Doctrine Query (cont)}} \tn % Row 14 \SetRowColor{LightBackground} Cache::MODE\_NORMAL & read and write \tn % Row Count 1 (+ 1) % Row 15 \SetRowColor{white} Cache::MODE\_REFRESH & no read, only refresh \tn % Row Count 3 (+ 2) % Row 16 \SetRowColor{LightBackground} \seqsplit{setCacheable(\$trueFalse)} & Enable/disable result caching \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.96 cm} x{3.04 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Magic repository functions}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{find}}(\$id) & Returns one entity \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{findOneBy}}(\$criteria, \$orderBy) & Returns one entity \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{findBy}}(\$criteria, \$orderBy, \$limit, \$offset) & Returns collection \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \$criteria = {[}'field' =\textgreater{} 'value'{]} & Single field / value \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \$criteria = {[}'field' =\textgreater{} {[}'value1', 'value2'{]}{]} & Single where-in \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \$criteria = {[}'field1' =\textgreater{} 'value', 'field2' =\textgreater{} 'value2'{]} & multiple fields / values \tn % Row Count 13 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\$repository = \$this-\textgreater{}getDoctrine()-\textgreater{}getRepository(Product::class); \newline \$product = \$repository-\textgreater{}findOneBy({[}'name' =\textgreater{} 'Keyboard'{]});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.24 cm} x{3.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Doctrine criteria - filtering collections}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{where}}(\$Expression) & Replaces previous statement \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {[}and/or{]}{\bf{Where}}(\$Expression) & Adds AND /OR where statement \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{orderBy}}(\$array) & Sets OrderBy \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} {\bf{setFirstResult}}(\$firstResult) & Sets first result \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{setMaxResult}}(\$max) & Sets Maximum results \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\$userCollection = \$group-\textgreater{}getUsers(); \newline \newline \$criteria = Criteria::create() \newline -\textgreater{}where(Criteria::expr()-\textgreater{}eq("birthday", "1982-02-17")) \newline -\textgreater{}orderBy(array("username" =\textgreater{} Criteria::ASC)) \newline -\textgreater{}setFirstResult(0) \newline -\textgreater{}setMaxResults(20) \newline ; \newline \$birthdayUsers = \$userCollection-\textgreater{}matching(\$criteria);} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.92 cm} x{4.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Doctrine ExpressionBuilder and Expr}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{andX}}(\$arg1, \$arg2, ...) & Multiple arguments AND \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{orX}}(\$arg1, \$arg2, ...) & Multiple arguments OR \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {[}n{]}{\bf{eq}}(\$field, \$value) & {[}Not{]} Equal \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{gt}}{[}e{]}(\$field, \$value) & Greater than {[}or equal{]} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{lt}}{[}e{]}(\$field, \$value) & Less than {[}or equal{]} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{isNull}}(\$field) & Is Null \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} {[}not{]}{\bf{in}}(\$field, array \$values) & {[}not{]} In \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} {\bf{memberOf}}(\$field, \$value) & {\bf{ExpressionBuilder only}} Member of \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{isMemberOf}}(\$field, \$value) & {\bf{Expr only}} Member of \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} {\bf{isNotNull}}(\$field) & {\bf{Expr only}} Is not Null \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{between}}(\$field, \$x, \$y) & {\bf{Expr only}} Between \$x and \$y \tn % Row Count 21 (+ 2) % Row 11 \SetRowColor{white} {\bf{trim}}(\$field) & {\bf{Expr only}} Trim \tn % Row Count 22 (+ 1) % Row 12 \SetRowColor{LightBackground} {\bf{concat}}(\$x, \$y) & {\bf{Expr only}} Concat \tn % Row Count 23 (+ 1) % Row 13 \SetRowColor{white} {\bf{literal}}(\$string) & {\bf{Expr only}} Literal \tn % Row Count 25 (+ 2) % Row 14 \SetRowColor{LightBackground} {\bf{lower}}(\$field) & {\bf{Expr only}} Lower case \tn % Row Count 27 (+ 2) % Row 15 \SetRowColor{white} {\bf{upper}}(\$field) & {\bf{Expr only}} Upper case \tn % Row Count 29 (+ 2) % Row 16 \SetRowColor{LightBackground} {\bf{count}}(\$field) & {\bf{Expr only}} count \tn % Row Count 30 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\# Doctrine Expr \# \newline Criteria::expr()-\textgreater{}orX( \newline Criteria::expr()-\textgreater{}eq('id', \$facilityId), \newline Criteria::expr()-\textgreater{}eq('active', TRUE) \newline ); \newline \newline \# Doctrine ExpressionBuilder \# \newline \$qb = \$this-\textgreater{}createQueryBuilder('f'); \newline \newline \$qb-\textgreater{}where(\$qb-\textgreater{}expr()-\textgreater{}eq('id', '?arg1')) \newline -\textgreater{}setParameter('arg1', \$facilityId); \newline \newline \$qb-\textgreater{}select(\$qb-\textgreater{}expr()-\textgreater{}substring('o.orderNumber', 4, 3)); \newline \newline \$qb-\textgreater{}select(\$qb-\textgreater{}expr()-\textgreater{}concat('p1.surname', \$qb-\textgreater{}expr()-\textgreater{}literal(','), 'p1.firstName');} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Doctrine Query Builder}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{setParameter}}(\$parameter, \$value)} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{addCriteria}}(Criteria \$criteria)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{[}get/set{]}{\bf{MaxResults}}(\$maxResults)} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{[}get/set{]}{\bf{FirstResult}}(\$firstResult)} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{getQuery}}()} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{add}}(\$dqlPartName, \$dqlPart, \$append = false)} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\$dqlPartName: select, from, join, set, where, groupBy, having, orderBy} \tn % Row Count 8 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\{\{bb\}\}{\emph{Wrappers for add():}}} \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{[}add{]}{\bf{select}}(\$select= null)} \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{delete}}(\$delete = null, \$alias = null)} \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{update}}(\$update = null, \$alias = null)} \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{set}}(\$key, \$value)} \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{from}}(\$from, \$alias, \$indexBy = null)} \tn % Row Count 14 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{[}inner/left{]}{\bf{join}}(\$join, \$alias, \$conditionType = null, \$condition = null, \$indexBy = null)} \tn % Row Count 16 (+ 2) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{[}and/or{]}{\bf{where}}(\$where)} \tn % Row Count 17 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{[}add{]}{\bf{groupBy}}(\$groupBy)} \tn % Row Count 18 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{[}and/or{]}{\bf{having}}(\$having)} \tn % Row Count 19 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{[}add{]}{\bf{orderBy}}(\$field, \$order = null)} \tn % Row Count 20 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.24 cm} x{3.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Doctrine raw SQL}} \tn % Row 0 \SetRowColor{LightBackground} \$Connection= \$EntityManager-\textgreater{}{\bf{getConnection}}(): Connection; & Get connection \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \$Statement = \$Connection-\textgreater{}{\bf{prepare}}(string \$sql): Statement; & Prepare statement from string \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \$Statement-\textgreater{}{\bf{bindValue}}(string|int \$param, \$value, \$type = null): bool & Bind a value to a corresponding name \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} \$Statement-\textgreater{}{\bf{execute}}(?array \$params = null): bool & Execute the statement \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} \$Statement-\textgreater{}{\bf{fetchAll}}(int \$fetchStyle = PDO::FETCH\_BOTH): array & Fetch all results \tn % Row Count 17 (+ 4) % Row 5 \SetRowColor{white} \$Statement-\textgreater{}{\bf{fetchOne}}(int \$fetchStyle = PDO::FETCH\_BOTH): array & Fetch single result \tn % Row Count 21 (+ 4) % Row 6 \SetRowColor{LightBackground} \$Statement-\textgreater{}{\bf{rowCount}}(): int & Return the number of rows \tn % Row Count 23 (+ 2) % Row 7 \SetRowColor{white} \$Statement-\textgreater{}{\bf{free}}(): void & Free stored result memory \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\$connection = \$entityManager-\textgreater{}{\bf{getConnection}}(); \newline \newline \$sql = 'SELECT * FROM events WHERE start\_date \textgreater{}= :startdate'; \newline \newline \$statement = \$conn-\textgreater{}{\bf{prepare}}(\$sql); \newline \$statement-\textgreater{}{\bf{bindValue}}('startdate', \$startDate-\textgreater{}format('Y-m-d H:i:s')); \newline \$statement-\textgreater{}{\bf{execute}}(); \newline \newline return \$statement-\textgreater{}{\bf{fetchAll}}();} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Authorization}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{IS\_AUTHENTICATED\_FULLY} & User has successfully authenticated, not via 'remember me cookie' \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \seqsplit{IS\_AUTHENTICATED\_REMEMBERED} & All logged in users \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} IS\_REMEMBERED & Only users authenticated using the remember me functionality \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} IS\_IMPERSONATOR & When the current user is impersonating another user in this session \tn % Row Count 11 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{All roles you assign to a user must begin with the ROLE\_ prefix in order for the default symfony RoleVoter to vote. Other prefixes require a custom voter.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Authorization in a controller}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# Example of using wrapper \# \newline % Row Count 1 (+ 1) public function hello(\$name) \newline % Row Count 2 (+ 1) \{ \newline % Row Count 3 (+ 1) // The second parameter is used to specify on what object the role is tested. \newline % Row Count 5 (+ 2) \$this-\textgreater{}denyAccessUnlessGranted('ROLE\_ADMIN', null, 'Unable to access this page!'); \newline % Row Count 7 (+ 2) // ... \newline % Row Count 8 (+ 1) \} \newline % Row Count 9 (+ 1) \# Example of using AuthorizationChecker \newline % Row Count 10 (+ 1) use Symfony\textbackslash{}Component\textbackslash{}Security\textbackslash{}Core\textbackslash{}Authorization\textbackslash{}AuthorizationCheckerInterface \newline % Row Count 12 (+ 2) use Symfony\textbackslash{}Component\textbackslash{}Security\textbackslash{}Core\textbackslash{}Exception\textbackslash{}AccessDeniedException; \newline % Row Count 14 (+ 2) public function hello(\$name, \seqsplit{AuthorizationCheckerInterface} \$authChecker) \newline % Row Count 16 (+ 2) \{ \newline % Row Count 17 (+ 1) if (false === \$authChecker-\textgreater{}isGranted('ROLE\_ADMIN')) \{ \newline % Row Count 19 (+ 2) throw new \seqsplit{AccessDeniedException('Unable} to access this page!'); \newline % Row Count 21 (+ 2) \} \newline % Row Count 22 (+ 1) // ... \newline % Row Count 23 (+ 1) \} \newline % Row Count 24 (+ 1) \# Example of using annotation \# \newline % Row Count 25 (+ 1) use Sensio\textbackslash{}Bundle\textbackslash{}FrameworkExtraBundle\textbackslash{}Configuration\textbackslash{}Security; \newline % Row Count 27 (+ 2) /** \newline % Row Count 28 (+ 1) * \seqsplit{@Security("has\_role('ROLE\_ADMIN')")} \newline % Row Count 29 (+ 1) */ \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Authorization in a controller (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{public function hello(\$name) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) // ... \newline % Row Count 3 (+ 1) \}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Persisting Entities}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{// get the entity manager that manages this entity \newline % Row Count 2 (+ 2) \$em = \$this-\textgreater{}getDoctrine()-\textgreater{} \newline % Row Count 3 (+ 1) \seqsplit{getManagerForClass(MyEntity::class);} \newline % Row Count 4 (+ 1) // create a new entity \newline % Row Count 5 (+ 1) \$entity = new MyEntity(); \newline % Row Count 6 (+ 1) // populate / alter properties \newline % Row Count 7 (+ 1) \$entity-\textgreater{}setName('Default Entity'); \newline % Row Count 8 (+ 1) // tell Doctrine you want to (eventually) save \newline % Row Count 9 (+ 1) \$em-\textgreater{}persist(\$entity); \newline % Row Count 10 (+ 1) // actually executes the queries \newline % Row Count 11 (+ 1) \$em-\textgreater{}flush();% Row Count 12 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Authorization via security.yaml}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# \seqsplit{config/packages/security.yaml} \newline % Row Count 1 (+ 1) security: \newline % Row Count 2 (+ 1) access\_control: \newline % Row Count 3 (+ 1) \# public access only for / \newline % Row Count 4 (+ 1) - \{ path: \textasciicircum{}/\$, roles: PUBLIC\_ACCESS \} \newline % Row Count 5 (+ 1) \# public access to login page /login \newline % Row Count 6 (+ 1) - \{ path: \textasciicircum{}/login, roles: PUBLIC\_ACCESS \} \newline % Row Count 7 (+ 1) \# or require ROLE\_ADMIN or ROLE\_USER\_ADMIN for /admin/users* \newline % Row Count 9 (+ 2) - \{ path: '\textasciicircum{}/admin/users', roles: {[}ROLE\_USER\_ADMIN, ROLE\_ADMIN{]} \} \newline % Row Count 11 (+ 2) \# require ROLE\_ADMIN for /admin* \newline % Row Count 12 (+ 1) - \{ path: \textasciicircum{}/admin, roles: ROLE\_ADMIN \} \newline % Row Count 13 (+ 1) \# authenticated users only to the rest /* \newline % Row Count 15 (+ 2) - \{ path: \textasciicircum{}/, roles: IS\_AUTHENTICATED\_FULLY% Row Count 17 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{No limit on amount of URL patterns. Each is a regular expression. First match will be used. \newline \newline Prepend the path with \textasciicircum{} to ensure only URLs beginning with the pattern are matched.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Authorization in template}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\{\% if \seqsplit{is\_granted('ROLE\_ADMIN')} \%\} \newline % Row Count 1 (+ 1) \textless{}a href="..."\textgreater{}Delete\textless{}/a\textgreater{} \newline % Row Count 2 (+ 1) \{\% endif \%\}% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Create a new form in a controller}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# Create a new form with a default name \# \newline % Row Count 1 (+ 1) \$form = \$this-\textgreater{}createFormBuilder(\$data) \newline % Row Count 2 (+ 1) -\textgreater{}add('dueDate', null, array( \newline % Row Count 3 (+ 1) 'widget' =\textgreater{} 'single\_text')) \newline % Row Count 4 (+ 1) -\textgreater{}add('save', SubmitType::class) \newline % Row Count 5 (+ 1) -\textgreater{}getForm(); \newline % Row Count 6 (+ 1) \# Create a form with a non-default name \# \newline % Row Count 7 (+ 1) \$form = \$this-\textgreater{}container-\textgreater{}get('form.factory') \newline % Row Count 8 (+ 1) -\textgreater{}createNamedBuilder( \newline % Row Count 9 (+ 1) 'form1', FormType::class, \$data) \newline % Row Count 10 (+ 1) -\textgreater{}add('dueDate', null, array( \newline % Row Count 11 (+ 1) 'widget' =\textgreater{} 'single\_text')) \newline % Row Count 12 (+ 1) -\textgreater{}add('save', SubmitType::class) \newline % Row Count 13 (+ 1) -\textgreater{}getForm();% Row Count 14 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Create a form from a class in a controller}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# Create a form from a form class with a default name \# \newline % Row Count 2 (+ 2) \$form = \$this-\textgreater{}createForm(TaskForm::class, \$data, array( \newline % Row Count 4 (+ 2) 'action' =\textgreater{} \$this-\textgreater{}generateUrl('target\_route'), \newline % Row Count 5 (+ 1) 'method' =\textgreater{} 'GET', \newline % Row Count 6 (+ 1) )); \newline % Row Count 7 (+ 1) \# Create a form from a form class with a non-default name \# \newline % Row Count 9 (+ 2) \$form = \$this-\textgreater{}container-\textgreater{}get('form.factory') \newline % Row Count 10 (+ 1) -\textgreater{}createNamed('form1', TaskForm::class, \$data, array( \newline % Row Count 12 (+ 2) 'action' =\textgreater{} \$this-\textgreater{}generateUrl('target\_route'), \newline % Row Count 14 (+ 2) 'method' =\textgreater{} 'GET', \newline % Row Count 15 (+ 1) ));% Row Count 16 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Form Options}} \tn % Row 0 \SetRowColor{LightBackground} '{\bf{action}}' =\textgreater{} '' & Where to send the form's data on submission (usually a URI) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} '{\bf{allow\_extra\_fields}}' =\textgreater{} false & Allow additional fields to be submitted \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} '{\bf{error\_mapping}}' =\textgreater{} \seqsplit{array('matchingCityAndZipCode'} =\textgreater{} 'city') & Modify the target of a validation error \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} '{\bf{extra\_fields\_message}}' =\textgreater{} 'This form should not contain extra fields.' & Validation error message if additional fields are submitted \tn % Row Count 13 (+ 4) % Row 4 \SetRowColor{LightBackground} '{\bf{inherit\_data}}' =\textgreater{} false & Inhered data from parent form or not \tn % Row Count 15 (+ 2) % Row 5 \SetRowColor{white} '{\bf{method}}' =\textgreater{} 'POST' & HTTP method used to submit the form \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} '{\bf{post\_max\_size\_message}}' =\textgreater{} 'The uploaded file was too large.' & Validation message for size of post form data \tn % Row Count 21 (+ 4) % Row 7 \SetRowColor{white} '{\bf{validation\_groups}}' =\textgreater{} false & Disable the Validation of Submitted Data \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{literal\}\}public function \seqsplit{configureOptions(OptionsResolver} \$resolver) \{ \newline \$resolver-\textgreater{}setDefaults(array( \newline \# Options go here \# \newline )); \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{0.864 cm} x{3.168 cm} x{2.088 cm} x{1.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{8.4cm}}{\bf\textcolor{white}{Log Levels / Console Verbosity (OutputInterface)}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{emergency()} & System is unusable. & & \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \seqsplit{alert()} & Action must be taken immediately. & & \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{critical()} & Critical conditions. & & \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \seqsplit{error()} & Runtime errors that do not require immediate action but should typically be logged and monitored. & \seqsplit{VERBOSITY\_QUIET} (-1) & -q / \seqsplit{stderr} \tn % Row Count 14 (+ 6) % Row 4 \SetRowColor{LightBackground} \seqsplit{warning()} & Exceptional occurrences that are not errors. & \seqsplit{VERBOSITY\_NORMAL} (0) & (non) / \seqsplit{stdout} \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} \seqsplit{notice()} & Normal but significant events. & \seqsplit{VERBOSITY\_VERBOSE} (1) & -v \tn % Row Count 19 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{info()} & Interesting events. & \seqsplit{VERBOSITY\_VERY\_VERBOSE} (2) & -vv \tn % Row Count 22 (+ 3) % Row 7 \SetRowColor{white} \seqsplit{debug()} & Detailed debug information. & \seqsplit{VERBOSITY\_DEBUG} (3) & -vvv \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}----} \SetRowColor{LightBackground} \mymulticolumn{4}{x{8.4cm}}{use Psr\textbackslash{}Log\textbackslash{}LoggerInterface; \newline \newline public function index(LoggerInterface \$logger) \{ \newline \$logger-\textgreater{}info('I just got the logger'); \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Console}} \tn % Row 0 \SetRowColor{LightBackground} bin\textbackslash{}console & List available commands and show the Symfony version \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} server:run & Run the built-in web server \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} assets:install -{}-symlink & Install bundle assets as a symlink or hardcopy \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} debug:autowire & Lists classes/interfaces you can use for autowiring \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} debug:config & Dumps the current configuration for an extension \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{debug:container} & Displays current services for an application \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} debug:form & Lists classes/interfaces you can use for autowiring \tn % Row Count 17 (+ 3) % Row 7 \SetRowColor{white} debug:route & Displays current routes for an application \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{literal\}\} \newline Usage: \newline php bin\textbackslash{}console command {[}options{]} {[}arguments{]} \newline \newline Options: \newline -h, -{}-help Display this help message \newline -q, -{}-quiet Do not output any message \newline -n, -{}-no-interaction Do not ask any interactive question \newline -e, -{}-env=ENV The environment name {[}default: "dev"{]} \newline -{}-no-debug Switches off debug mode \newline -v|vv|vvv, -{}-verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Basic form}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{class TaskForm extends AbstractType \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) public function buildForm( \newline % Row Count 3 (+ 1) FormBuilderInterface \$builder, \newline % Row Count 4 (+ 1) array \$options) \newline % Row Count 5 (+ 1) \{ \newline % Row Count 6 (+ 1) \$builder \newline % Row Count 7 (+ 1) -\textgreater{}add('dueDate', DateType::class, array( \newline % Row Count 8 (+ 1) 'widget' =\textgreater{} 'single\_text', \newline % Row Count 9 (+ 1) 'label' =\textgreater{} 'Due Date', \newline % Row Count 10 (+ 1) 'required' =\textgreater{} false, \newline % Row Count 11 (+ 1) 'attr' =\textgreater{} array('maxlength' =\textgreater{} 10), \newline % Row Count 12 (+ 1) 'constraints' =\textgreater{} array(new Length( \newline % Row Count 13 (+ 1) array('max' =\textgreater{} 10))) \newline % Row Count 14 (+ 1) )) \newline % Row Count 15 (+ 1) -\textgreater{}add('save', SubmitType::class); \newline % Row Count 16 (+ 1) \} \newline % Row Count 17 (+ 1) public function configureOptions( \newline % Row Count 18 (+ 1) OptionsResolver \$resolver) \newline % Row Count 19 (+ 1) \{ \newline % Row Count 20 (+ 1) \$resolver-\textgreater{}setDefaults(array( \newline % Row Count 21 (+ 1) 'method' =\textgreater{} 'GET', \newline % Row Count 22 (+ 1) )); \newline % Row Count 23 (+ 1) \} \newline % Row Count 24 (+ 1) \}% Row Count 25 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{TwigBridge - Forms}} \tn % Row 0 \SetRowColor{LightBackground} \{\{ {\bf{form}}(view, variables) \}\} & Render whole form \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \{\{bt\}\}\{\{ {\bf{form\_start}}(view, variables) \}\} & \{\{bt\}\}Render start tag \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \{\{ {\bf{form\_errors}}(view) \}\} & Render global errors \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \{\{ {\bf{form\_row}}(view, variables) \}\} & Render all the fields \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \{\{ {\bf{form\_rest}}(view, variables) \}\} & Render all other fields \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \{\{ {\bf{form\_end}}(view, variables) \}\} & Render end tag + \{\{nl\}\}all other fields \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} \{\{bt\}\}\{\{ {\bf{form\_row}}(view.field) \}\} & \{\{bt\}\}Render field label, error \{\{nl\}\}and widget \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} \{\{bt\}\}\{\{ {\bf{form\_label}}(view.field, label, variables) \}\} & \{\{bt\}\}Render field label \tn % Row Count 19 (+ 3) % Row 8 \SetRowColor{LightBackground} \{\{ {\bf{form\_errors}}(view.field) \}\} & Render field error \tn % Row Count 21 (+ 2) % Row 9 \SetRowColor{white} \{\{ {\bf{form\_widget}}(view.field, variables) \}\} & Render field widget \tn % Row Count 24 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\# render a label, but display 'Your Name' and add a "foo" class to it \#\} \newline \{\{ form\_label(form.name, 'Your Name', \{'label\_attr': \{'class': 'foo'\}\}) \}\} \newline \newline \{\# render a widget, but add a "foo" class to it \#\} \newline \{\{ form\_widget(form.name, \{'attr': \{'class': 'foo'\}\}) \}\} \newline \newline \{\# render a field row, but display a label with text "foo" \#\} \newline \{\{ form\_row(form.name, \{'label': 'foo'\}) \}\}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Response from a controller}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{render}}(\$view, \$parameters, \$response = null) & Render the template and return a Response \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{json}}(\$data, \$status = 200, \$headers = array(), \$context = array()) & Encode data and return a Json response \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} {\bf{file}}(\$file, \$fileName = null, \$disposition = \seqsplit{ResponseHeaderBag::DISPOSITION\_ATTACHMENT)} & Return a file response \tn % Row Count 12 (+ 5) % Row 3 \SetRowColor{white} {\bf{redirectToRoute}}(\$route, \$parameters = array(), \$status = 302) & Redirect to route \tn % Row Count 16 (+ 4) % Row 4 \SetRowColor{LightBackground} {\bf{redirect}}(\$url, \$status = 302) & Redirect to external URL \tn % Row Count 18 (+ 2) % Row 5 \SetRowColor{white} {\bf{forward}}(\$controller, \$path = array(), \$query = array()) & Forwards the request to another controller \tn % Row Count 21 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{return \$this-\textgreater{}render('admin/post/show.html.twig', {[} \newline ~~~ 'post' =\textgreater{} \$post, \newline ~~~ 'delete\_form' =\textgreater{} \$deleteForm-\textgreater{}createView(), \newline {]}); \newline \newline return \$this-\textgreater{}json(\$data);} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}