<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kostaNovak</title>
    <description>The latest articles on DEV Community by kostaNovak (@kostanovak).</description>
    <link>https://dev.to/kostanovak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1197200%2F0937004f-7a04-490e-9b74-6575c2489c0a.png</url>
      <title>DEV Community: kostaNovak</title>
      <link>https://dev.to/kostanovak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kostanovak"/>
    <language>en</language>
    <item>
      <title>EP 5 - Conditionals and Booleans</title>
      <dc:creator>kostaNovak</dc:creator>
      <pubDate>Sat, 11 Nov 2023 13:18:28 +0000</pubDate>
      <link>https://dev.to/kostanovak/ep-5-conditionals-and-booleans-488</link>
      <guid>https://dev.to/kostanovak/ep-5-conditionals-and-booleans-488</guid>
      <description>&lt;p&gt;So interesting lesson where we touch again on string interpolation and introduce booleans and conditionals.&lt;/p&gt;

&lt;p&gt;I solved task myself first by including conditional logic inside h1 like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nv"&gt;$name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Dark Matter"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$read&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$read&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"You have read &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"You have NOT read &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jeffrey did it afterwards in more effective way I think with separating conditional logic and putting it inside first php tag before h1 and also by introducing $message variable like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="nv"&gt;$name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Dark Matter"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$read&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$read&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"You have read &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"You have NOT read &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So basically we are only echoing out our variable inside h1 tag and keeping conditional logic in separate php tag. More elegant solution I guess.&lt;/p&gt;

</description>
      <category>interpolation</category>
      <category>conditionals</category>
      <category>php</category>
    </item>
    <item>
      <title>EP 4: Variables</title>
      <dc:creator>kostaNovak</dc:creator>
      <pubDate>Fri, 10 Nov 2023 22:36:45 +0000</pubDate>
      <link>https://dev.to/kostanovak/ep-4-variables-90m</link>
      <guid>https://dev.to/kostanovak/ep-4-variables-90m</guid>
      <description>&lt;p&gt;We learned about string concatenation in php.&lt;/p&gt;

&lt;p&gt;It's done with &lt;code&gt;.&lt;/code&gt; inbetween 2 strings.&lt;br&gt;
Also we learned how to define variable&lt;br&gt;
&lt;code&gt;$example = "John";&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Also, how to use that variable in a string that we concatenate:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "Hello $example";&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
would print out Hello John in this example.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>EP 3: Your first php tag</title>
      <dc:creator>kostaNovak</dc:creator>
      <pubDate>Fri, 10 Nov 2023 22:22:39 +0000</pubDate>
      <link>https://dev.to/kostanovak/ep-3-your-first-php-tag-26kg</link>
      <guid>https://dev.to/kostanovak/ep-3-your-first-php-tag-26kg</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So in the start we learn some basic commands in terminal like:&lt;/p&gt;

&lt;p&gt;mkdir - creating folder&lt;br&gt;
cd - changing directory&lt;/p&gt;

&lt;p&gt;Now for the important stuff, to run a php server we need to get in project directory where our index file is, and run this in terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php -S localhost:8888
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(8888 could be any other port number)&lt;/p&gt;

&lt;p&gt;This makes our website run on our local server.&lt;br&gt;
Also basic php tag is explained &lt;code&gt;&amp;lt;?php ?&amp;gt;&lt;/code&gt; Everything inside it is considered php code.&lt;br&gt;
That should be about it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>EP 2: Tools of the Trade</title>
      <dc:creator>kostaNovak</dc:creator>
      <pubDate>Tue, 07 Nov 2023 22:47:55 +0000</pubDate>
      <link>https://dev.to/kostanovak/ep-2-tools-of-the-trade-2bmi</link>
      <guid>https://dev.to/kostanovak/ep-2-tools-of-the-trade-2bmi</guid>
      <description>&lt;p&gt;In this episode we are showed all tools necessary to start this tutorial.&lt;/p&gt;

&lt;p&gt;First IDE is mentioned, after that how to install php and mysql.&lt;br&gt;
Also terminal is mentioned, it will also be occasionally used.&lt;br&gt;
Next is UI for database, TablePlus is recommended but i think I'll stick with DBeaver for Linux.&lt;br&gt;
That should be all for this episode, short and sweet!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Taking notes</title>
      <dc:creator>kostaNovak</dc:creator>
      <pubDate>Mon, 30 Oct 2023 09:07:37 +0000</pubDate>
      <link>https://dev.to/kostanovak/taking-notes-1434</link>
      <guid>https://dev.to/kostanovak/taking-notes-1434</guid>
      <description>&lt;p&gt;I decided to start taking notes for each lesson I watch on laracasts.com website, starting from PHP for beginners tutorial...That's why I'm making this blog in a first place.&lt;/p&gt;

&lt;p&gt;I'll make notes after each lesson I watch, not during it, supposedly it should help with learning retention.&lt;br&gt;
I took this advice from Kevin Powells newsletter, it does make some sense.&lt;/p&gt;

&lt;p&gt;Also another benefit is I think it should make my online learning more fun in a way.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>php</category>
      <category>laracasts</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
