<?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: sachiko-kame</title>
    <description>The latest articles on DEV Community by sachiko-kame (@sachikokame).</description>
    <link>https://dev.to/sachikokame</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%2F398798%2F87e11286-ca8b-480c-8a89-afb2c364b793.png</url>
      <title>DEV Community: sachiko-kame</title>
      <link>https://dev.to/sachikokame</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sachikokame"/>
    <language>en</language>
    <item>
      <title>Things I thought I should be careful about when writing my own XSS penetration tests.</title>
      <dc:creator>sachiko-kame</dc:creator>
      <pubDate>Sat, 25 Feb 2023 12:21:14 +0000</pubDate>
      <link>https://dev.to/sachikokame/things-i-thought-i-should-be-careful-about-when-writing-my-own-xss-penetration-tests-36dm</link>
      <guid>https://dev.to/sachikokame/things-i-thought-i-should-be-careful-about-when-writing-my-own-xss-penetration-tests-36dm</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This is an article that I google translated my article and reviewed a little.🙇‍♀️&lt;/p&gt;

&lt;p&gt;Sorry for my bad English.🙇‍♀️&lt;/p&gt;

&lt;p&gt;There are some parts that are omitted.🙇‍♀️&lt;/p&gt;

&lt;p&gt;The article is below. (Japanese)🙇‍♀️&lt;br&gt;
&lt;a href="https://qiita.com/sachiko-kame/items/d6128c0674a75f5ec809" rel="noopener noreferrer"&gt;https://qiita.com/sachiko-kame/items/d6128c0674a75f5ec809&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;in the world,&lt;br&gt;
Penetration testing tools such as &lt;a href="https://www.zaproxy.org/download/" rel="noopener noreferrer"&gt;OWASP ZAP&lt;/a&gt;,&lt;br&gt;
There are useful XSS checking strings such as &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html#xss-locator-polygot" rel="noopener noreferrer"&gt;XSS Locator (Polygot)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;but,&lt;br&gt;
How far can this be detected?&lt;br&gt;
How should I test it in the first place?&lt;br&gt;
Are there any precautions for inspection?&lt;br&gt;
How can I write an XSS Penetration Test to detect more XSS?&lt;br&gt;
I think there are many things to think about!&lt;/p&gt;

&lt;p&gt;I thought about such a variety of things, so as a result of actually doing it,&lt;br&gt;
I would like to write about what I think you should be careful about when writing your own XSS penetration test!&lt;br&gt;
thank you!&lt;/p&gt;

&lt;p&gt;Here's a &lt;a href="https://github.com/sachiko-kame/XSSSamples" rel="noopener noreferrer"&gt;github link&lt;/a&gt; for you to try!&lt;/p&gt;
&lt;h2&gt;
  
  
  『OWASP ZAP』 VS 『XSS Locator (Polygot)』
&lt;/h2&gt;

&lt;p&gt;First of all, on the page with various vulnerabilities,&lt;br&gt;
I checked how much it can detect with "OWASP ZAP" and "XSS Locator (Polygot)"!&lt;/p&gt;

&lt;p&gt;There are various things I picked up from various sites and things I made by looking at Polygot's character strings.&lt;/p&gt;

&lt;p&gt;You can see a lot by looking at the table below.&lt;br&gt;
&lt;strong&gt;・Both light XSS can be detected to some extent.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;・there Are times when "OWASP ZAP" does not check the scheme&lt;/strong&gt; ■sample-a9&lt;br&gt;
&lt;strong&gt;・Both of them basically cannot detect vulnerabilities using regular expressions.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;・Both of them are basically unable to detect vulnerabilities at error locations.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;・"owasp zap" is less detectable than "XSS Locator (Polygot)".&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;・ "XSS Locator (Polygot)" may not be detected if the detection method or input is wrong. (details later)&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Examples of expected values to be entered during normal operation&lt;/th&gt;
&lt;th&gt;OWASP ZAP&lt;/th&gt;
&lt;th&gt;XSS Locator (Polygot)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in &amp;lt;title&amp;gt; * sample-a1&lt;br&gt;
&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in &amp;lt;style&amp;gt; *sample-a2&lt;/td&gt;
&lt;td&gt;red&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Omission of escaping in &amp;lt;textarea&amp;gt; *sample-a3&lt;/td&gt;
&lt;td&gt;This is my first post!&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in &amp;lt;script&amp;gt; ※sample-a4&lt;/td&gt;
&lt;td&gt;sss&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in &amp;lt;xmp&amp;gt; ※sample-a5&lt;/td&gt;
&lt;td&gt;sample&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in &amp;lt;pre&amp;gt; ※sample-a6&lt;/td&gt;
&lt;td&gt;sample&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient escaping *sample-a7&lt;br&gt;Unescaped 『'』 and『"』&lt;/td&gt;
&lt;td&gt;red&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient escaping *sample-a8&lt;br&gt;Unescaped  『'』 and『"』&lt;/td&gt;
&lt;td&gt;"color: red"&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Not detected&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detected &lt;br&gt;(Enclosed in "" required)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;url scheme check omission ※sample-a9&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;cannot be detected&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Omission of escaping where php string output is enclosed in HTML comments *sample-b1&lt;/td&gt;
&lt;td&gt;sample&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inappropriate escaping *Sample-b2&lt;br&gt;php output is surrounded by js escape function&lt;/td&gt;
&lt;td&gt;sample&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape leak in for statement ※sample-b3&lt;/td&gt;
&lt;td&gt;Nice weather#Event#Weather#aaa&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;br&gt;(must be entered after #)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission in the for statement *Sample-b4&lt;br&gt;I added processing to play only the characters in the script&lt;/td&gt;
&lt;td&gt;It's a nice weather#Event#Weather#aaa&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;br&gt;(Behind # required)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient checking due to user input in regular expression (in php code) *sample-b5&lt;br&gt;Do not create basic regular expression with user input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io#abc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient check due to user input in regular expression (in js code) *sample-b6&lt;br&gt;Do not create basic regular expression with user input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io#abc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient checking due to some user input in the regular expression (in php code) *sample-b7&lt;br&gt;Basic regular expression is not created with user input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://192.168.99.100:86/sample- b7/?name=sachiko&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insufficient checking due to some user input in the regular expression (in js code) *sample-b8&lt;br&gt;Basic regular expression is not created with user input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://192.168.99.100:86/sample- b8/?name=sachiko&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Undetectable&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape leak after putting prefix in style class description * sample-b9&lt;/td&gt;
&lt;td&gt;php&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cannot be detected&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escape omission of error output wording of trycatch *sample-c1&lt;/td&gt;
&lt;td&gt;sample&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cannot be detected&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cannot be detected&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;iframe url scheme check omission * sample-c2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;td&gt;Detected&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  "XSS Locator (Polygot)" may not be detected if the detection method or input is wrong.
&lt;/h2&gt;

&lt;p&gt;It may be natural, but&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You should put the value of "XSS Locator (Polygot)" where the user can freely enter.&lt;/li&gt;
&lt;li&gt;If there is an instruction to insert a character specified by the system in a place where the user can freely enter, the character specified by the system + "XSS Locator (Polygot)" should be inserted.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If you can enter anything after "#" ……

○
https://sachiko-kame.github.io#&amp;lt;&amp;lt;Polygot value&amp;gt;&amp;gt;

×
&amp;lt;&amp;lt;Polygot value&amp;gt;&amp;gt;

×(I really want to do this if possible)
https://sachiko-kame.github.io/&amp;lt;&amp;lt;Polygot value&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If you are instructing to enclose the input value with ""……

○
"&amp;lt;&amp;lt;Polygot value&amp;gt;&amp;gt;"

×(I really want to do this if possible)
&amp;lt;&amp;lt;Polygot value&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Summary of things I thought I should be careful about when creating my own XSS penetration test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The inspection will be conducted without WAF.&lt;br&gt;
If there is a WAF, it seems that there are cases where the attack could not be detected because it was repelled by the WAF.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basically, the attack code uses &lt;code&gt;XSS Locator (Polygot)&lt;/code&gt; and &lt;code&gt;|.|&lt;/code&gt;.&lt;br&gt;
As you can see from the table above, this can detect to some extent, so I feel that this is the appropriate attack code. &lt;code&gt;|.|&lt;/code&gt; is explained again a little later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;First, output the normal pattern of the system. ex) If you do 〇〇, it will behave as 〇〇.&lt;br&gt;
On the contrary, to look for suspicious things that do not behave this way. I think it would be difficult to find vulnerabilities in regular expressions without doing something like this.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example
・If you type 〇〇 in the form, 〇〇 will be displayed in this place.
・If you type red in the form, this place will turn red.
・If you type "sample" in the form, it will be URL#sample here and the appropriate part will be displayed when you click it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Identify areas where users can freely enter data. Reference: sample-b3&lt;br&gt;
To put the attack code here and inspect it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Where the user can freely input + If there is anything the system is asking for, it will also be identified. Enclose in "". Reference: sample-a8&lt;br&gt;
To put the attack code here and inspect it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When diagnosing vulnerability (on your own), try clicking and focusing to see if there is any difference from normal behavior. Reference: sample-a7&lt;br&gt;
Assuming when js is installed in the event handler or src&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example
・Check that js does not fire without doing anything.
・Confirm that js is not fired by hitting the form.
・Check that js does not fire when clicked.
・Check if the behavior is normal and expected behavior.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Check whether it fires even when an error occurs. *Reference: sample-c1&lt;br&gt;
It's like inserting an attack code and checking it when an error occurs.&lt;br&gt;
Basically, I think that it will be like entering and confirming with "&amp;lt;&amp;lt;character string that causes an error&amp;gt;&amp;gt;&amp;lt;&amp;lt;Polygot&amp;gt;&amp;gt;".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Considering the possibility of regular expressions, it is suspicious if characters that always behave differently and do not behave as intended.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I feel like I'm going to put in a character that looks like a bug and detect it!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&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;I've tried to show what I've tried in the table below.&lt;/p&gt;

&lt;p&gt;①&lt;br&gt;
↓&lt;br&gt;
&lt;/p&gt;

&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;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;inspected pattern&lt;/th&gt;
&lt;th&gt;what you entered&lt;/th&gt;
&lt;th&gt;What behavior was normal?&lt;/th&gt;
&lt;th&gt;What is the behavior of the bug&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;sample-b5&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io#①&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clickable URL =&amp;gt;&lt;code&gt;https://sachiko-kame.github.io&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Clickable URL =&amp;gt;&lt;code&gt;http://192.168.99.100:86/sample-b5/?name=https%3A%2F%2Fsachiko-kame.github.io%23%7C.%7C&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sample-b6&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://sachiko-kame.github.io#①&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clickable URL =&amp;gt;&lt;code&gt;https://sachiko-kame.github.io&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Clickable URL =&amp;gt;&lt;code&gt;http://192.168.99.100:86/sample-b6/&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sample-b7&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://192.168.99.100:86/sample-b7/?①=①&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;image url =&amp;gt; &lt;code&gt;https://sachiko-kame.github.io/images/sachiko.png&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;A lot of ① are displayed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sample-b8&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://192.168.99.100:86/sample-b8/?①=①&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;image url =&amp;gt; &lt;code&gt;https://sachiko-kame.github.io/images/sachiko.png&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;A lot of ① are displayed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Confirmation that the intended tag is not included. If you don't go this far, you won't be able to find it completely sample-c1&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As a bonus, if there is a tag that is allowed where you are entering a long sentence, it might be better if you could enter an event handler there and check if it doesn't fire at all. I'm thinking. I wrote this as a bonus.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  lastly
&lt;/h2&gt;

&lt;p&gt;Thank you for reading to the end! !🙇‍♀️&lt;/p&gt;

</description>
      <category>async</category>
      <category>agile</category>
      <category>softwaredevelopment</category>
      <category>productivity</category>
    </item>
    <item>
      <title>CakePHP Form button Customize</title>
      <dc:creator>sachiko-kame</dc:creator>
      <pubDate>Mon, 21 Sep 2020 14:21:21 +0000</pubDate>
      <link>https://dev.to/sachikokame/cakephp-form-button-customize-1ge9</link>
      <guid>https://dev.to/sachikokame/cakephp-form-button-customize-1ge9</guid>
      <description>&lt;h1&gt;
  
  
  how to
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Add the class you want to adapt to create
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'class'&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'aaa'&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'controller'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Advices'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'action'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'heart'&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'advice_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'value'&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nv"&gt;$advices&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Heart'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;How to write on the button of the class
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'button'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'reset'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'submit'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#db116c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.1rem&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#db116c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Appearance after change&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NWdvTHC_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/38ulj0rvu4pg9dsjnfm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NWdvTHC_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/38ulj0rvu4pg9dsjnfm5.png" alt="Appearance after change" width="216" height="82"&gt;&lt;/a&gt;        &lt;/p&gt;




&lt;h1&gt;
  
  
  A little more
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Image of unpressed heart
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'♡'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'button'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'reset'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'submit'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f1f2f4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.1rem&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#606c76&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-moz-border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-webkit-border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#606c76&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ahGgqez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3szb6x74ivadyp2l9sxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ahGgqez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3szb6x74ivadyp2l9sxk.png" alt="Alt Text" width="168" height="86"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Image of pressed heart
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'♥'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'button'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'reset'&lt;/span&gt;&lt;span class="o"&gt;],&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'submit'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;.aaa&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#db116c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.1rem&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#db116c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-moz-border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-webkit-border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2.3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aAzFbI9o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jf212dnst9m8bckrbeh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aAzFbI9o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jf212dnst9m8bckrbeh.png" alt="Alt Text" width="162" height="78"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>php</category>
    </item>
    <item>
      <title>Form Helper【CakePHP】</title>
      <dc:creator>sachiko-kame</dc:creator>
      <pubDate>Mon, 21 Sep 2020 09:49:56 +0000</pubDate>
      <link>https://dev.to/sachikokame/form-helper-cakephp-1ekl</link>
      <guid>https://dev.to/sachikokame/form-helper-cakephp-1ekl</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Please watch over gently🙇‍♀️&lt;br&gt;
I will write about cakePHP "Form Helper"!&lt;br&gt;
List of things you will often see.&lt;/p&gt;

&lt;h1&gt;
  
  
  Overall picture
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'controller'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Advices'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'action'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;control&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'user_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'value'&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nv"&gt;$userID&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tap'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Create
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;Cake\View\Helper\FormHelper::create(mixed $context = null, array $options = [])&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Basic
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  change action
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'action'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'publish'&lt;/span&gt;&lt;span class="p"&gt;]]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  change controller &amp;amp; action
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'controller'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Articles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'action'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'publish'&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  External
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'http://www.google.com/search'&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Control
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;Cake\View\Helper\FormHelper::control(string $fieldName, array $options = [])&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Basic
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;control&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;control&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'checkbox'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;textarea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'advice'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'rows'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'3'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Hide
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'article_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'value'&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;'1'&lt;/span&gt; &lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;?$this-&amp;gt;Form-&amp;gt;hidden('id');&lt;/p&gt;

&lt;h4&gt;
  
  
  Remove required
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;control&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  button
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Add'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  end
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://book.cakephp.org/4/ja/views/helpers/form.html"&gt;reference&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cakephp</category>
    </item>
    <item>
      <title>Create cell【CakePHP】</title>
      <dc:creator>sachiko-kame</dc:creator>
      <pubDate>Sun, 06 Sep 2020 09:22:29 +0000</pubDate>
      <link>https://dev.to/sachikokame/create-cell-cakephp-2iao</link>
      <guid>https://dev.to/sachikokame/create-cell-cakephp-2iao</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Please watch over gently🙇‍♀️&lt;br&gt;
I will write about cakePHP "cell"!&lt;/p&gt;
&lt;h1&gt;
  
  
  How to use
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Create 'class' and 'template'
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;[src/View/Cell/InboxCell.php]&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="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\View\Cell&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Cake\View\Cell&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InboxCell&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Cell&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nv"&gt;$hello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"hello!!!(*´ω｀*)"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sample'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$hello&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[templates/cell/Inbox/display.php]&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;div&amp;gt;&lt;/span&gt;
    message✨ &lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$sample&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  use
&lt;/h1&gt;

&lt;p&gt;On the "/templates/????/index.php"&lt;/p&gt;

&lt;p&gt;The following description&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;?=$this-&amp;gt;cell('Inbox::display');?&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  display
&lt;/h1&gt;

&lt;p&gt;http://〇〇/????&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q3xvvJNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/prftcjhwsqx24qbmqtck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q3xvvJNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/prftcjhwsqx24qbmqtck.png" alt="スクリーンショット 2020-09-06 17.44.56" width="408" height="90"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  A little more
&lt;/h1&gt;

&lt;p&gt;Show what you get in the model&lt;/p&gt;

&lt;p&gt;Assumption: You have a created model.This time 'tags'&lt;/p&gt;

&lt;p&gt;[src/View/Cell/InboxCell.php]&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="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\View\Cell&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Cake\View\Cell&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InboxCell&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Cell&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;loadModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tags'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nv"&gt;$tags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Tags&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tags'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$tags&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[templates/cell/Inbox/display.php]&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;table&amp;gt;&lt;/span&gt;
  &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$tags&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$tag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;?=&lt;/span&gt; &lt;span class="nv"&gt;$tag&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;endforeach&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;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where you want to use↓&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;?=$this-&amp;gt;cell('Inbox::display');?&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;display&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WyOKHr-H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtcin4o7emefi0mr7qz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WyOKHr-H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qtcin4o7emefi0mr7qz8.png" alt="スクリーンショット 2020-09-06 18.15.20" width="880" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Overall picture
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SRig29mQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/913yvqrxewebww3y3vuz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRig29mQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/913yvqrxewebww3y3vuz.png" alt="スクリーンショット 2020-09-06 18.31.39" width="880" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Don't forget the escape
&lt;/h1&gt;

&lt;p&gt;I forgot,&lt;br&gt;
So I will not forget&lt;br&gt;
↓&lt;br&gt;
[templates/cell/Inbox/display.php]&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="nf"&gt;h&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$tag&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://book.cakephp.org/4/ja/views/cells.html"&gt;reference&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>cakephp</category>
    </item>
    <item>
      <title>I tried using CakePHP 4.0.8 🍓with Docker. (apach)</title>
      <dc:creator>sachiko-kame</dc:creator>
      <pubDate>Sun, 31 May 2020 02:34:18 +0000</pubDate>
      <link>https://dev.to/sachikokame/i-tried-using-cakephp-4-0-8-with-docker-apach-55af</link>
      <guid>https://dev.to/sachikokame/i-tried-using-cakephp-4-0-8-with-docker-apach-55af</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://qiita.com/sachiko-kame/items/489231d8fef7252a87d3" rel="noopener noreferrer"&gt;☀️日本語バージョン&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sachiko-kame/docker_cakePHP" rel="noopener noreferrer"&gt;☀️github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to write the procedure I'm writing on my_github here.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step1 Up to the necessary container creation!
&lt;/h1&gt;

&lt;p&gt;clone&lt;br&gt;
&lt;code&gt;$ git clone https://github.com/sachiko-kame/docker_cakePHP.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clone and use the following command where &lt;strong&gt;docker-compose.yml&lt;/strong&gt; file exists&lt;br&gt;
&lt;code&gt;$ docker-compose up --build -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check if the container was created successfully&lt;br&gt;
&lt;code&gt;$ docker ps&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;output👁&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d6e752c1a5b7        2020_5_30_template_cakephp_apach   "docker-php-entrypoi…"   4 seconds ago       Up 4 seconds        0.0.0.0:80-&amp;gt;80/tcp                  sample-apache-container1
602a4868b08b        2020_5_30_template_cakephp_mysql   "docker-entrypoint.s…"   4 seconds ago       Up 4 seconds        0.0.0.0:3306-&amp;gt;3306/tcp, 33060/tcp   sample-mysql1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ip check&lt;br&gt;
&lt;code&gt;$ docker-machine ip default&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;output👁&lt;br&gt;
&lt;/p&gt;

&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;Confirm the pasted ip on your browser.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8shwg7k14ka0147g5o9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8shwg7k14ka0147g5o9q.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Step2 Enter apache container and install cakePHP
&lt;/h1&gt;

&lt;p&gt;Enter the Apache container. The following command. d6e752c1a5b7, please put your own&lt;br&gt;
&lt;code&gt;$ docker exec -i -t d6e752c1a5b7 bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;apache　in🚪&lt;br&gt;
&lt;code&gt;root@d6e752c1a5b7:/var/www/html#&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;put composer&lt;br&gt;
&lt;code&gt;$ curl -sS https://getcomposer.org/installer | php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;put cakePHP in composer&lt;br&gt;
&lt;code&gt;$ php composer.phar create-project --prefer-dist cakephp/app:4.* my_app_name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Set Folder Permissions ? (Default to Y) [Y,n]? → y → enter!&lt;/p&gt;

&lt;p&gt;Move the contents of the cakePHP folder&lt;br&gt;
&lt;code&gt;$ mv my_app_name/* /var/www/html/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;output👁&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@d6e752c1a5b7:/var/www/html# ls
README.md  bin  composer.json  composer.lock  composer.phar  config  index.php  logs  my_app_name  phpcs.xml  phpunit.xml.dist  plugins  resources  src  templates  tests  tmp  vendor  webroot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you reload the browser and it looks like the following, it's OK !!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fum2tch6utump3ynp2erp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fum2tch6utump3ynp2erp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is OK to reload again as below !!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdgwohxmd3i5r62hni9qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdgwohxmd3i5r62hni9qt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Exit the container&lt;br&gt;
&lt;code&gt;$ exit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;apache　out🚪&lt;/p&gt;
&lt;h1&gt;
  
  
  Setp3 Resolving any errors
&lt;/h1&gt;

&lt;p&gt;The reason is a problem with file permissions, so&lt;br&gt;
The following command.&lt;br&gt;
&lt;code&gt;$ chmod -R 777 apach/html/logs&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ chmod -R 777 apach/html/tmp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OK if you reload the browser and the error disappears&lt;/p&gt;
&lt;h1&gt;
  
  
  Step4 Create a database in Mysql container and complete the cakePHP database connection.
&lt;/h1&gt;

&lt;p&gt;Enter the mysql container. 602a4868b08b, please put your own&lt;br&gt;
&lt;code&gt;$ docker exec -i -t 602a4868b08b bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;mysql　in🚪&lt;br&gt;
&lt;code&gt;root@602a4868b08b:/#&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Login to mysql with mysql container&lt;br&gt;
&lt;code&gt;$ mysql -u root -p&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are asked a password, you can use &lt;code&gt;example&lt;/code&gt;&lt;br&gt;
By the way, the password will not be displayed even if you type it!&lt;br&gt;
output👁&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.20 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql&amp;gt; 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a database for this time in the mysql container&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ create database mydb01;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ show databases;&lt;/code&gt; ← Just a confirmation command&lt;/p&gt;

&lt;p&gt;exit from mysql container&lt;br&gt;
You can get out by hitting &lt;code&gt;$ exit;&lt;/code&gt; twice!&lt;/p&gt;

&lt;p&gt;mysql　out🚪&lt;/p&gt;

&lt;p&gt;Modify the cakePHP file to connect to the database. Change the Datasources of "/apach/html/config/app_local.php" as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    'Datasources' =&amp;gt; [
        'default' =&amp;gt; [
          'className' =&amp;gt; 'Cake\Database\Connection',
          'driver' =&amp;gt; 'Cake\Database\Driver\Mysql',
          'persistent' =&amp;gt; false,
          'encoding' =&amp;gt; 'utf8mb4',
          'timezone' =&amp;gt; 'UTC',
          'cacheMetadata' =&amp;gt; true,

          'host' =&amp;gt; 'mysql',
            /*
             * CakePHP will use the default DB port based on the driver selected
             * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
             * the following line and set the port accordingly
             */
            //'port' =&amp;gt; 'non_standard_port_number',

            'username' =&amp;gt; 'root',
            'password' =&amp;gt; 'example',

            'database' =&amp;gt; 'mydb01',
            /**
             * If not using the default 'public' schema with the PostgreSQL driver
             * set it here.
             */
            //'schema' =&amp;gt; 'myapp',

            /**
             * You can use a DSN string to set the entire configuration
             */
            'url' =&amp;gt; env('DATABASE_URL', null),
        ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If possible, I think that the database connection can be made as follows.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5rwu57do6mlusm0ae83h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5rwu57do6mlusm0ae83h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Step5 Set up around apache so that cakePHP can be rewritten
&lt;/h1&gt;

&lt;p&gt;apache　in🚪&lt;br&gt;
Enter the apache container&lt;br&gt;
&lt;code&gt;$ docker exec -i -t d6e752c1a5b7 bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Command depression to activate the rewrite module&lt;br&gt;
&lt;code&gt;$ a2enmod rewrite&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ service apache2 restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;apache　out (auto)🚪&lt;br&gt;
Build Docker again&lt;br&gt;
&lt;code&gt;$ docker-compose up --build -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If there is a file that has not been moved as follows, move it&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9scy0bynqsmfg6fnoffy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9scy0bynqsmfg6fnoffy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is OK if you hit it in the form of ip address / pages and return to the ip address!&lt;/p&gt;

&lt;p&gt;The my_app_name folder is empty so delete it!&lt;/p&gt;
&lt;h1&gt;
  
  
  Step6 Create a little page and check the display.
&lt;/h1&gt;

&lt;p&gt;Move to /apach/html and create a controller for user with the following command.&lt;br&gt;
&lt;code&gt;$ bin/cake bake controller users&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Modify the following files created by the command&lt;br&gt;
/apach/html/src/Controller/UsersController.php&lt;br&gt;
Comment out in index () as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    public function index()
    {
        //$users = $this-&amp;gt;paginate($this-&amp;gt;Users);

        //$this-&amp;gt;set(compact('users'));
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then create a users folder in the /apach/html/templates folder. Create index.php file in it&lt;br&gt;
There is no problem if you write something like the following in index.php!&lt;br&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;sample!!!&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhxolq1pxr8vf43d9htch.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhxolq1pxr8vf43d9htch.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Finally
&lt;/h1&gt;

&lt;p&gt;It was my first post on dev.to!✨&lt;br&gt;
Thank you for reading to the end!ヽ(´▽｀)/&lt;/p&gt;

</description>
      <category>docker</category>
      <category>cakephp</category>
      <category>apache</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
