Tutorial by Examples

If you want to replace parts of your website, ajax is an easy way to do it. The website.html where you want to replace the content based on the selected value: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> ...
Let's initially understand basic types of custom validators: Inline Validator Standalone Validator Inline Validator: It is the type of the validator we create inside the class which is basically a method we define just like other methods but with extra parameters which is passed in by Yii2. ...
In Twig template, Request object is available at {{ app.request }} When you want display request method in Twig, try this: <p>Request method: {{ app.request.method }}</p> In PHP template <p>Request method: <?php echo $app->getRequest()->getMethod() ?></p>...
While designing a form, you might like to group a few input fields into a group to help organise the form layout. This can be done by using the tag . Here is an example for using it. For each fieldset, you can set a legend for the set using the tag LEGEND TEXT Example <form> <fieldset...
This is a jumbotron with a title, a content and a button. Code <div class="jumbotron"> <h1>Title text</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tortor ipsum, convallis sit.</p> <p><a class="btn btn-default&...
IObserver<T> and IObservable<T> interfaces can be used to implement observer pattern in .NET IObservable<T> interface represents the class that sends notifications IObserver<T> interface represents the class that receives them public class Stock { private string Sym...
Code function add_the_theme_page(){ add_menu_page('Theme page title', 'Theme menu label', 'manage_options', 'theme-options', 'page_content', 'dashicons-book-alt'); } add_action('admin_menu', 'add_the_theme_page'); function page_content(){ echo '<div class="wrap"><h2&...
This example is a very simple Spring Boot application. Maven Dependencies At first add the following dependencies to your project. Spring Initializr is recommended when you create a new project. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr...
First you have to create a file constants.php and it is a good practice to create this file inside app/config/ folder. You can also add constants.php file in compose.json file. Example File: app/config/constants.php Array based constants inside the file: return [ 'CONSTANT' => 'This...
Code add_action('admin_menu', 'register_my_custom_submenu_page'); function register_my_custom_submenu_page() { add_submenu_page( 'tools.php', 'Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_cust...
Code <h1><?php echo get_option( 'blogname' ); ?></h1> Output Name of the blog in H1 style
Code <p><?php echo esc_html( sprintf( __( 'Character set: %s', 'textdomain' ), get_option( 'blog_charset' ) ) ); ?></p> Output Character set: UTF-8
Code <?php echo get_option( 'something_bla_bla_bla' ); ?> Output false Code <?php echo get_option( 'something_bla_bla_bla', 'Oh no!' ); ?> Output Oh no!
By using tools like lscpu as lscpu is an easy way to get CPU information. $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 So...
library(tidyr) ## example data df <- read.table(text =" numbers firstName secondName 1 1 1.5862639 0.4087477 2 2 0.1499581 0.9963923 3 3 0.4117353 0.3740009 4 4 -0.4926862 0.4437916", header = T) df # numbers firstName secondName # 1 ...
Sometimes we'd like to pause code execution to inspect the state of the application (see Debugging). When running code through the MATLAB editor, this can be done using the "Pause" button in the UI or by pressing Ctrl+c (on Windows). However, when a computation was initiated from a GUI (vi...
VideoWriter videoWriter; videoWriter = new VideoWriter(outputFile, VideoWriter.fourcc('x', '2','6','4'), fps, frameSize, isRGB); //We have stated that we will use x264 as codec with FourCC //For writing, we add the following method and it will write the image we give as parameter...
/* * Component is an interface * which all elements (files, * folders, links ...) will implement */ class Component { public: virtual int getSize() const = 0; }; /* * File class represents a file * in file system. */ class File : public Component { public: virtual int...
Including a Static Section on a page is similar to including a snippet. The only difference is instead of using the word include you use the word section. {% section 'section-file-name' %} Using this tag will "hardcode" the section into your theme at the place where you put the code an...
For sections, instead of utilizing one big JSON file (like settings_schema.json, they instead keep their schema within the file of the section that is using it. To do this {% schema %} {% endschema %} tags are used and JSON is placed between them. From there, the format is similar to settings_schema...

Page 1156 of 1336