{"id":3528,"date":"2019-02-07T02:51:55","date_gmt":"2019-02-07T02:51:55","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=3528"},"modified":"2019-02-07T03:28:24","modified_gmt":"2019-02-07T03:28:24","slug":"symfony-4-blog","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/02\/07\/symfony-4-blog\/","title":{"rendered":"Symfony 4 Blog"},"content":{"rendered":"<p>Ref: http:\/\/tutorials.mustangx.org\/tutorials\/create-advanced-blog-symfony-4-p1-2\/<\/p>\n<p>Getting Started with Symfony 4.x<br \/>\nThere has been a lot of changes made for Symfony 4, seems to be ok though. I was quite confused, mainly the file structure of Symfony 3 is what I was used to. Then I discovered a nice and quick tutorial with the title\u00a0Beginners Symfony 4 Tutorial.<\/p>\n<p>The file structure has change if you are developing a web application. There are many, many changes that I may not catch as we move through this.<\/p>\n<p>Step 1 \u2013 Symfony Website Skeleton<br \/>\nI am not going to detail this part, if you need that go to the link above.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4$ composer create-project symfony\/website-skeleton symfony4-blog\r\nInstalling symfony\/website-skeleton (v4.2.3.1)\r\n  - Installing symfony\/website-skeleton (v4.2.3.1): Downloading (100%)         \r\nCreated project in symfony4-blog\r\nLoading composer repositories with package information\r\nInstalling dependencies (including require-dev) from lock file\r\nPackage operations: 99 installs, 0 updates, 0 removals\r\n  - Installing ocramius\/package-versions (1.3.0): Downloading (100%)         \r\n  - Installing symfony\/flex (v1.1.8): Downloading (100%)         \r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\n\r\nPrefetching 74 packages \ud83c\udfb6\r\n  - Downloading (100%)\r\n\r\n  - Installing symfony\/polyfill-mbstring (v1.10.0): Loading from cache\r\n  - Installing symfony\/contracts (v1.0.2): Loading from cache\r\n  - Installing doctrine\/lexer (v1.0.1): Loading from cache\r\n  - Installing doctrine\/annotations (v1.6.0): Loading from cache\r\n  - Installing doctrine\/reflection (v1.0.0): Loading from cache\r\n  - Installing doctrine\/event-manager (v1.0.0): Loading from cache\r\n  - Installing doctrine\/collections (v1.5.0): Loading from cache\r\n  - Installing doctrine\/cache (v1.8.0): Loading from cache\r\n  - Installing doctrine\/persistence (v1.1.0): Loading from cache\r\n  - Installing symfony\/doctrine-bridge (v4.2.3): Loading from cache\r\n  - Installing doctrine\/inflector (v1.3.0): Loading from cache\r\n  - Installing doctrine\/doctrine-cache-bundle (1.3.5): Loading from cache\r\n  - Installing doctrine\/instantiator (1.1.0): Loading from cache\r\n  - Installing symfony\/stopwatch (v4.2.3): Loading from cache\r\n  - Installing symfony\/console (v4.2.3): Loading from cache\r\n  - Installing zendframework\/zend-eventmanager (3.2.1): Loading from cache\r\n  - Installing zendframework\/zend-code (3.3.1): Loading from cache\r\n  - Installing ocramius\/proxy-manager (2.1.1): Loading from cache\r\n  - Installing doctrine\/dbal (v2.9.2): Loading from cache\r\n  - Installing doctrine\/migrations (v2.0.0): Loading from cache\r\n  - Installing egulias\/email-validator (2.1.7): Loading from cache\r\n  - Installing jdorn\/sql-formatter (v1.2.17): Loading from cache\r\n  - Installing phpdocumentor\/reflection-common (1.0.1): Loading from cache\r\n  - Installing phpdocumentor\/type-resolver (0.4.0): Loading from cache\r\n  - Installing psr\/cache (1.0.1): Loading from cache\r\n  - Installing psr\/container (1.0.0): Loading from cache\r\n  - Installing psr\/simple-cache (1.0.1): Loading from cache\r\n  - Installing symfony\/http-foundation (v4.2.3): Loading from cache\r\n  - Installing symfony\/event-dispatcher (v4.2.3): Loading from cache\r\n  - Installing psr\/log (1.1.0): Loading from cache\r\n  - Installing symfony\/debug (v4.2.3): Loading from cache\r\n  - Installing symfony\/http-kernel (v4.2.3): Loading from cache\r\n  - Installing symfony\/routing (v4.2.3): Loading from cache\r\n  - Installing symfony\/finder (v4.2.3): Loading from cache\r\n  - Installing symfony\/filesystem (v4.2.3): Loading from cache\r\n  - Installing symfony\/dependency-injection (v4.2.3): Loading from cache\r\n  - Installing symfony\/config (v4.2.3): Loading from cache\r\n  - Installing symfony\/var-exporter (v4.2.3): Loading from cache\r\n  - Installing symfony\/cache (v4.2.3): Loading from cache\r\n  - Installing symfony\/framework-bundle (v4.2.3): Loading from cache\r\n  - Installing doctrine\/common (v2.10.0): Loading from cache\r\n  - Installing sensio\/framework-extra-bundle (v5.2.4): Loading from cache\r\n  - Installing symfony\/asset (v4.2.3): Loading from cache\r\n  - Installing symfony\/dotenv (v4.2.3): Loading from cache\r\n  - Installing symfony\/expression-language (v4.2.3): Loading from cache\r\n  - Installing symfony\/inflector (v4.2.3): Loading from cache\r\n  - Installing symfony\/property-access (v4.2.3): Loading from cache\r\n  - Installing symfony\/options-resolver (v4.2.3): Loading from cache\r\n  - Installing symfony\/intl (v4.2.3): Loading from cache\r\n  - Installing symfony\/polyfill-intl-icu (v1.10.0): Loading from cache\r\n  - Installing symfony\/form (v4.2.3): Loading from cache\r\n  - Installing monolog\/monolog (1.24.0): Loading from cache\r\n  - Installing symfony\/monolog-bridge (v4.2.3): Loading from cache\r\n  - Installing doctrine\/orm (v2.6.3): Loading from cache\r\n  - Installing doctrine\/doctrine-bundle (1.10.1): Loading from cache\r\n  - Installing doctrine\/doctrine-migrations-bundle (v2.0.0): Loading from cache\r\n  - Installing symfony\/orm-pack (v1.0.6): Loading from cache\r\n  - Installing symfony\/security-core (v4.2.3): Loading from cache\r\n  - Installing symfony\/security-http (v4.2.3): Loading from cache\r\n  - Installing symfony\/security-guard (v4.2.3): Loading from cache\r\n  - Installing symfony\/security-csrf (v4.2.3): Loading from cache\r\n  - Installing symfony\/security-bundle (v4.2.3): Loading from cache\r\n  - Installing symfony\/serializer (v4.2.3): Loading from cache\r\n  - Installing symfony\/property-info (v4.2.3): Loading from cache\r\n  - Installing webmozart\/assert (1.4.0): Loading from cache\r\n  - Installing phpdocumentor\/reflection-docblock (4.3.0): Loading from cache\r\n  - Installing symfony\/serializer-pack (v1.0.2): Loading from cache\r\n  - Installing swiftmailer\/swiftmailer (v6.1.3): Loading from cache\r\n  - Installing symfony\/swiftmailer-bundle (v3.2.5): Loading from cache\r\n  - Installing symfony\/translation (v4.2.3): Loading from cache\r\n  - Installing twig\/twig (v2.6.2): Loading from cache\r\n  - Installing symfony\/twig-bridge (v4.2.3): Loading from cache\r\n  - Installing symfony\/validator (v4.2.3): Loading from cache\r\n  - Installing psr\/link (1.0.0): Loading from cache\r\n  - Installing fig\/link-util (1.0.0): Loading from cache\r\n  - Installing symfony\/web-link (v4.2.3): Loading from cache\r\n  - Installing symfony\/yaml (v4.2.3): Loading from cache\r\n  - Installing symfony\/process (v4.2.3): Loading from cache\r\n  - Installing facebook\/webdriver (1.6.0): Loading from cache\r\n  - Installing symfony\/polyfill-php72 (v1.10.0): Loading from cache\r\n  - Installing symfony\/var-dumper (v4.2.3): Loading from cache\r\n  - Installing symfony\/twig-bundle (v4.2.3): Loading from cache\r\n  - Installing symfony\/web-profiler-bundle (v4.2.3): Loading from cache\r\n  - Installing symfony\/profiler-pack (v1.0.4): Loading from cache\r\n  - Installing symfony\/monolog-bundle (v3.3.1): Loading from cache\r\n  - Installing symfony\/debug-bundle (v4.2.3): Loading from cache\r\n  - Installing easycorp\/easy-log-handler (v1.0.7): Loading from cache\r\n  - Installing symfony\/debug-pack (v1.0.7): Loading from cache\r\n  - Installing symfony\/dom-crawler (v4.2.3): Loading from cache\r\n  - Installing nikic\/php-parser (v4.2.0): Loading from cache\r\n  - Installing symfony\/maker-bundle (v1.11.3): Loading from cache\r\n  - Installing symfony\/phpunit-bridge (v4.2.3): Loading from cache\r\n  - Installing symfony\/browser-kit (v4.2.3): Loading from cache\r\n  - Installing symfony\/panther (v0.2.0): Loading from cache\r\n  - Installing symfony\/css-selector (v4.2.3): Loading from cache\r\n  - Installing symfony\/test-pack (v1.0.5): Loading from cache\r\n  - Installing symfony\/web-server-bundle (v4.2.3): Loading from cache\r\nGenerating autoload files\r\nocramius\/package-versions:  Generating version class...\r\nocramius\/package-versions: ...done generating version class\r\nSymfony operations: 21 recipes (b3986ed40336733aed65b5bbdded81f4)\r\n  - Configuring symfony\/flex (&gt;=1.0): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/framework-bundle (&gt;=4.2): From github.com\/symfony\/recipes:master\r\n  - Configuring doctrine\/annotations (&gt;=1.0): From github.com\/symfony\/recipes:master\r\n  - Configuring doctrine\/doctrine-cache-bundle (&gt;=1.3.5): From auto-generated recipe\r\n  - Configuring symfony\/console (&gt;=3.3): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/routing (&gt;=4.2): From github.com\/symfony\/recipes:master\r\n  - Configuring sensio\/framework-extra-bundle (&gt;=5.2): From github.com\/symfony\/recipes:master\r\n  - Configuring doctrine\/doctrine-bundle (&gt;=1.6): From github.com\/symfony\/recipes:master\r\n  - Configuring doctrine\/doctrine-migrations-bundle (&gt;=1.2): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/security-bundle (&gt;=3.3): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/swiftmailer-bundle (&gt;=2.5): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/translation (&gt;=3.3): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/validator (&gt;=4.1): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/twig-bundle (&gt;=3.3): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/web-profiler-bundle (&gt;=3.3): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/monolog-bundle (&gt;=3.1): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/debug-bundle (&gt;=4.1): From github.com\/symfony\/recipes:master\r\n  - Configuring easycorp\/easy-log-handler (&gt;=1.0): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/maker-bundle (&gt;=1.0): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/phpunit-bridge (&gt;=4.1): From github.com\/symfony\/recipes:master\r\n  - Configuring symfony\/web-server-bundle (&gt;=3.3): From github.com\/symfony\/recipes:master\r\nExecuting script cache:clear [OK]\r\nExecuting script assets:install public [OK]\r\n\r\nSome files may have been created or updated to configure your new packages.\r\nPlease review, edit and commit them: these files are yours.\r\n\r\n              \r\n What's next? \r\n              \r\n\r\n  * Run your application:\r\n    1. Change to the project directory\r\n    2. Create your code repository with the git init command\r\n    3. Run composer require server --dev to install the development web server,\r\n       or configure another supported web server https:\/\/symfony.com\/doc\/current\/setup\/web_server_configuration.html\r\n\r\n  * Read the documentation at https:\/\/symfony.com\/doc\r\n\r\n                        \r\n Database Configuration \r\n                        \r\n\r\n  * Modify your DATABASE_URL config in .env\r\n\r\n  * Configure the driver (mysql) and\r\n    server_version (5.7) in config\/packages\/doctrine.yaml\r\n\r\n              \r\n How to test? \r\n              \r\n\r\n  * Write test cases in the tests\/ folder\r\n  * Run php bin\/phpunit<\/pre>\n<p>Step 2 \u2013 Change into your new directory:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4$ cd symfony4-blog\/\r\nteddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$<\/pre>\n<p>Step 3 \u2013 Install the Symfony Web Server Bundle: (NO NEED)<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ composer require server --dev\r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\nRestricting packages listed in \"symfony\/symfony\" to \"4.2.*\"\r\n.\/composer.json has been updated\r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\nRestricting packages listed in \"symfony\/symfony\" to \"4.2.*\"\r\nNothing to install or update\r\nGenerating autoload files\r\nocramius\/package-versions:  Generating version class...\r\nocramius\/package-versions: ...done generating version class\r\nExecuting script cache:clear [OK]\r\nExecuting script assets:install public [OK]\r\n<\/pre>\n<p>Step 4 \u2013 Now let\u2019s fire up the web server<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console server:start\r\n\r\n                                                                                \r\n [OK] Server listening on http:\/\/127.0.0.1:8000<\/pre>\n<p><a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Welcome-.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3531\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Welcome-.jpg\" alt=\"\" width=\"882\" height=\"489\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Welcome-.jpg 882w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Welcome--300x166.jpg 300w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Welcome--768x426.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a>OR CAN USE PHP SERVER CLI : php bin\/console server:run<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console server:run \r\n                                                                                \r\n [OK] Server listening on http:\/\/127.0.0.1:8000                                 \r\n                                                                                \r\n\r\n \/\/ Quit the server with CONTROL-C.                                             \r\n\r\nPHP 7.2.14-1+ubuntu16.04.1+deb.sury.org+1 Development Server started at Thu Feb  7 10:00:54 2019\r\nListening on http:\/\/127.0.0.1:8000\r\nDocument root is \/home\/teddy\/Documents\/works\/symfony4\/symfony4-blog\/public\r\nPress Ctrl-C to quit.<\/pre>\n<p>That command will start the server and this one will stop it.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console server:stop\r\n\r\n                                                                                \r\n [OK] Stopped the web server.<\/pre>\n<p>Note: You do not need to have any other server running. It may cause problems.<\/p>\n<p>Create an .htaccess file (FOR APACHE WEBSERVER)<br \/>\nMein is like this. Test it out and see if it works for you.<\/p>\n<p>Now COPY &amp; PASTE the following:<\/p>\n<pre class=\"lang:default decode:true \"># Enable rewrite engine and route requests to framework\r\nRewriteEngine On\r\nRewriteBase \/\r\n  \r\nRewriteCond %{REQUEST_URI} ^\/robots.txt\r\nRewriteRule ^(.*)$ \/public\/robots.txt [L]\r\n  \r\n# resources\r\nRewriteCond %{REQUEST_URI} ^\/images\/ [OR]\r\nRewriteCond %{REQUEST_URI} ^\/js\/ [OR]\r\n  \r\nRewriteCond %{REQUEST_URI} ^\/fonts\/ [OR]\r\nRewriteCond %{REQUEST_URI} ^\/css\/\r\nRewriteRule ^(.*)$ \/public\/$1 [L]\r\n  \r\nRewriteCond %{REQUEST_URI} !^\/public\/\r\nRewriteRule ^(.*)$ \/public\/$1 [QSA,L]<\/pre>\n<p>Setup the DB (MySql)<br \/>\nInside the\u00a0.env\u00a0file (probably hidden) find this line<\/p>\n<pre class=\"lang:default decode:true \">DATABASE_URL=mysql:\/\/db_user:db_password@127.0.0.1:3306\/db_name<\/pre>\n<p>replace &#8216;db_user&#8217;, &#8216;db_password&#8217; and &#8216;db_name&#8217; according to\u00a0 your database credential.<br \/>\n<span class=\"rcp-restricted-content-message\">SORRY, ONLY ADMIN CAN SHOW THIS!<\/span><br \/>\nOnce that\u2019s done, we need to do this (make sure you have the correct db info added first):<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console doctrine:database:create\r\nCreated database `sf4_blog` for connection named default<\/pre>\n<p>If you already have the database, it&#8217;d show this error:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console doctrine:database:create\r\nCould not create database `sf4_blog` for connection named default\r\nAn exception occurred while executing 'CREATE DATABASE `sf4_blog`':\r\n\r\nSQLSTATE[HY000]: General error: 1007 Can't create database 'sf4_blog'; database exists<\/pre>\n<p>Auto Versioning setup<br \/>\nGet the auto versioning setup first.<br \/>\nNOTE: This has changed and is easier to install thanks to Flex.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ composer update\r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\nRestricting packages listed in \"symfony\/symfony\" to \"4.2.*\"\r\nPackage operations: 0 installs, 1 update, 0 removals\r\n  - Updating ocramius\/proxy-manager (2.1.1 =&gt; 2.2.2): Downloading (connecting...Downloading (100%)         \r\nWriting lock file\r\nGenerating autoload files\r\nocramius\/package-versions:  Generating version class...\r\n\r\nWhat about running composer global require symfony\/thanks &amp;&amp; composer thanks now?\r\nThis will spread some \ud83d\udc96  by sending a \u2605  to the GitHub repositories of your fellow package maintainers.\r\n\r\nocramius\/package-versions: ...done generating version class\r\nExecuting script cache:clear [OK]\r\nExecuting script assets:install public [OK]<\/pre>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ composer require shivas\/versioning-bundle\r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\nUsing version ^3.1 for shivas\/versioning-bundle\r\n.\/composer.json has been updated\r\nCannot create cache directory \/home\/teddy\/.composer\/cache\/repo\/https---flex.symfony.com\/, or directory is not writable. Proceeding without cache\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\nRestricting packages listed in \"symfony\/symfony\" to \"4.2.*\"\r\n\r\nPrefetching 2 packages \ud83c\udfb6\r\n  - Downloading (100%)\r\n\r\nPackage operations: 2 installs, 0 updates, 0 removals\r\n  - Installing nikolaposa\/version (2.2.2): Loading from cache\r\n  - Installing shivas\/versioning-bundle (3.1.3): Loading from cache\r\nWriting lock file\r\nGenerating autoload files\r\nocramius\/package-versions:  Generating version class...\r\nocramius\/package-versions: ...done generating version class\r\nSymfony operations: 1 recipe (2a272251fc87f1a8e5906923edd9fdc4)\r\n  - Configuring shivas\/versioning-bundle (&gt;=3.1.3): From auto-generated recipe\r\nExecuting script cache:clear [OK]\r\nExecuting script assets:install public [OK]\r\n\r\nSome files may have been created or updated to configure your new packages.\r\nPlease review, edit and commit them: these files are yours.<\/pre>\n<p>The version is automatically updated with Composer and available in your application.<\/p>\n<pre class=\"lang:default decode:true \"># PHP\r\ngetenv('SHIVAS_APP_VERSION')\r\n\r\n# Twig\r\n{{ shivas_app_version }}<\/pre>\n<p>Console commands<br \/>\nThere are two available console commands. The app:version:bump command is automatically called by Composer on every install and update.<\/p>\n<pre class=\"lang:default decode:true \"># This will display all available version providers\r\nbin\/console app:version:list-providers\r\n\r\n# Display a dry run of a version bump\r\nbin\/console app:version:bump -d<\/pre>\n<p>Go ahead and test those two commands and see what it outputs.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console app:version:list-providers\r\nRegistered version providers\r\n ========== ========================================================= ========== =========== \r\n  Alias      Class                                                     Priority   Supported  \r\n ========== ========================================================= ========== =========== \r\n  version    Shivas\\VersioningBundle\\Provider\\VersionProvider          100        No         \r\n  git        Shivas\\VersioningBundle\\Provider\\GitRepositoryProvider    -25        No         \r\n  revision   Shivas\\VersioningBundle\\Provider\\RevisionProvider         -50        No         \r\n  init       Shivas\\VersioningBundle\\Provider\\InitialVersionProvider   -75        Yes        \r\n ========== ========================================================= ========== ===========<\/pre>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console app:version:bump -d\r\nProvider: Shivas\\VersioningBundle\\Provider\\InitialVersionProvider\r\nFormatter: Shivas\\VersioningBundle\\Formatter\\GitDescribeFormatter\r\n10:16:34 WARNING   [cache] Failed to save key \"version\" (Version\\Version) [\"key\" =&gt; \"version\",\"type\" =&gt; \"Version\\Version\",\"exception\" =&gt; Symfony\\Component\\Cache\\Exception\\InvalidArgumentException { \u2026}]\r\nCurrent version: 0.1.0\r\nNew version: 0.1.1\r\nDry run, skipping version bump<\/pre>\n<p>Create an Advanced Blog with Symfony 4 \u2013 part3 (FrontController)<br \/>\nLast Updated On March 28, 2018<br \/>\nIntroduction<br \/>\nThis part of the tutorial will concentrate on getting a basic Homepage\/Frontpage structure setup. I opted for a typical blog look.<br \/>\nWe will remove files and folders as well add new ones. The Controller for the homepage will be created and the basic page should be viewable at the end.<\/p>\n<p>Get Twitter Bootstrap Layout<br \/>\nI want to have a different look this time, so we will be using some premade templates from the Startbootstrap website. The one we want is released with an MIT license.<\/p>\n<p>First create the PageController<br \/>\nIt is easy to do with Symfony 4.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/symfony4\/symfony4-blog$ php bin\/console make:controller\r\n\r\n Choose a name for your controller class (e.g. VictoriousPuppyController):\r\n &gt; PageController\r\n\r\n created: src\/Controller\/PageController.php\r\n created: templates\/page\/index.html.twig\r\n\r\n           \r\n  Success! \r\n           \r\n\r\n Next: Open your new controller class and add some pages!<\/pre>\n<p>Let\u2019s see what got created for us. We have a\u00a0PageController.php\u00a0file in our\u00a0src\/Controllers\u00a0folder and inside of the\u00a0templates\u00a0folder we have a new folder and a new file,\u00a0page\/index.html.twig<\/p>\n<p>Now that was all I discovered. Run the server: php bin\/console s:r<br \/>\nthen open the page on http:\/\/localhost:8000\/page<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Hello-PageController.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3535\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Hello-PageController.jpg\" alt=\"\" width=\"708\" height=\"240\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Hello-PageController.jpg 708w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2019\/02\/Hello-PageController-300x102.jpg 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: http:\/\/tutorials.mustangx.org\/tutorials\/create-advanced-blog-symfony-4-p1-2\/ Getting Started with Symfony 4.x There has been a lot of changes made for Symfony 4, seems to be ok though. I was quite confused, mainly the file structure of Symfony 3 is what I was used to. Then I discovered a nice and quick tutorial with the title\u00a0Beginners Symfony 4 Tutorial. The &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/02\/07\/symfony-4-blog\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Symfony 4 Blog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,79,13],"tags":[],"class_list":["post-3528","post","type-post","status-publish","format-standard","hentry","category-symfony","category-symfony-4","category-tutorial"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=3528"}],"version-history":[{"count":6,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3528\/revisions"}],"predecessor-version":[{"id":3530,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3528\/revisions\/3530"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=3528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=3528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=3528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}