Laravel

[Laravel] 5 – Connect to MySQL

Database config In laravel 5, there is file ( /config/database.php ) controlling the database connection, however, modifying the default value is not suggested

It directly takes parameter from the env_variable and establish connection, therefore, we should modify the .env files located in root folder ( / )

  Controller and views   Targeted URL : www.domainName.com/info     /routes/web.php Call the…

Continue Reading

Laravel

[Lavarel] 4 – Blade template engine

  The command list needed for creating a simple blade template

  Under the /resouces/views/, there are

  main.blade.php The @yield declares the section layout called ‘content’

  contact.blade.php It extends the main.blade.php layout and pass data from @section to @endsection INTO the @yield

 

PHP

[PHP] PayPal portal

Basic Paypal HTML

 

PHP, Plugins

ElevateZoom

Official documentation of ElevateZoom HTML

  Javascript

  The javascript method define the image container with id “gal1”, and the required image for zooming with id “zoom_03”, user can override the default constraints with the above parameter.      

PHP

[PHP] Ajax with jQuery

HTML

Javascript

PHP (checkbox.php)

The process is invoked by the checkbox, clicking on the checkbox triggers “priceFilter” javascript function, passing “this” as parameter. Since the id of the checkbox input is passed together with “this”, the function check the status of the checkbox and pass the data into ajax function to “checkbox.php”, upon successful ajax request, the…

Continue Reading

Laravel, PHP

[Lavarel] 3 – Pass data from Controller to View

/app/Http/Controllers/PagesController.php Method One -> with (“argName”, $variable);

Method Two ->withArgsName($variable);

Laravel, PHP

[Lavarel] 2 – Route and Controller basic

/app/Http/Controllers/PagesController.php

  /routes/web.php

  There are three views under the directory, /resources/view/pages/, including: welcome.blade.php about.blade.php contact.blade.php

Laravel, PHP

[Lavarel] 1 – Route and views basic

Version 5.4.25 /routes/web.php

It simply links between the url “/about” to the about.blade.php under views folder, i.e. /resources/views/about.blade.php Check the result browsing domainName.com/about

PHP

[PHP]MySQL related

Simple Connection (init.php)

Simple query

Search through array