Keep Learning


php is oops is great















Public html folder ke andar
view and api folder hota hai
Class view

Payload . Request ko dikhata hai
Cn class name
Inspect tool
Api ajax call
Practical use
Netwrok tab any call registered

Payment name cash
Call createpayment type call
Click on payload

First thing hit is API
Class call
Debug how logic works
Open inspect window
Open network tab
See for api
Read api file in html public folder
CN nomenclature for class module
Purchase order is class inwhich
Createpayment type method defined
Public html ke bahar hai class name
Two class hota hai first
Purchase order class dusra SQL class
Class me businees logic jab SQL se data agaya
SQL query dekna ho






What is $this in PHP?
In PHP, $this keyword references the current object of the class.
The $this keyword allows you to access the properties and methods of the current object
within the class using the object operator (->):


The $this keyword is only available within a class method .
It doesn’t exist outside of the class.
If you attempt to use the $this outside of a class, you’ll get an error.

When you access an object property using the $this keyword,
you use the $ with the this keyword only. And you don’t use the $ with the property name





CSS list

list-style-type: circle/square/upper-roman/lower-alpha/lower-alpha;
list-style-position: outside/inside;;
List - Shorthand property: list-style: square inside url("sqpurple.gif");

There are four different combinators in CSS:

descendant selector (space)
child selector (>)
adjacent sibling selector (+)
general sibling selector (~)
inline style=" height:75px;width:200px ;"
text-transform: uppercase/lowercase;/capitalize;
text-align: center/left/right/justify;
vertical-align: baseline;
vertical-align: text-top/text-bottom/sub/super;






CSS Table
border-collapse: collapse; collapse boder in single line
text-align: center;
The vertical-align property sets the vertical alignment (like top, bottom, or middle) of the content in or .
By default, the vertical alignment of the content in a table is middle (for both and elements).
To control the space between the border and the content in a table, use the padding property on and elements:
Use the :hover selector on to highlight table rows on mouse over:
tr:hover {background-color: coral;}
tr:nth-child(even) {background-color: #f2f2f2;}
A responsive table will display a horizontal scroll bar if the screen is too small to display the full content:
Add a container element (like

) with overflow-x:auto around the element to make it responsiv


CSS advance

button:
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
padding: 10px 24px;
border-radius: 2px
border: 2px solid #4CAF50;
se the transition-duration property to determine the speed of the "hover" effect:
.button:hover {
background-color: #4CAF50; /* Green */
color: white;
}

The inherit keyword specifies that a property should inherit its value from its parent element.
The inherit keyword can be used for any CSS property, and on any HTML element.
span {
color: blue;
border: 1px solid black;
}

.extra span {
color: inherit;
}

The initial keyword is used to set a CSS property to its default value.
The initial keyword can be used for any CSS property, and on any HTML element.


box-shadow





















































Value ValueDescription
none Default value. No shadow is displayed
h-offset Required. The horizontal offset of the shadow. A positive value puts the
shadow on the right side of the box, a negative value puts the shadow on the
left side of the box
v-offset Required. The vertical offset of the shadow. A positive value puts the
shadow below the box, a negative value puts the shadow above the box
blur Optional. The blur radius. The higher the number, the more blurred the
shadow will be
spread Optional. The spread radius. A positive value increases the size of the
shadow, a negative value decreases the size of the shadow
color Optional. The color of the shadow. The default value is the text color. Look at CSS Color Values for a complete list of possible color values.

Note: In Safari (on PC) the color parameter is required. If you do not specify the color, the shadow is not displayed at all.
inset Optional. Changes the shadow from an outer shadow (outset) to an inner shadow
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit





User name Host name Password Global privileges User group Grant Action
Any % No USAGE No Edit privileges Edit privileges Export Export
kamlu % Yes ALL PRIVILEGES Yes Edit privileges Edit privileges Export Export
pma localhost No USAGE No Edit privileges Edit privileges Export Export
root 127.0.0.1 No ALL PRIVILEGES Yes Edit privileges Edit privileges Export Export
root ::1 No ALL PRIVILEGES Yes Edit privileges Edit privileges Export Export
root localhost No ALL PRIVILEGES Yes Edit privileges Edit privileges Export Export


Data base name in php my admin local host : kamlu
username :kamlu
password: kamlu@123
how to open php my admin in local host : localhost/phpmyadmin/index.php



kamsite Maintenance credential
email: giga.kumar@gmail.com
username: kamlu
password: kamlu@123




Single and Double Quotes in JavaScript Strings
Strings in JavaScript are contained within a pair of either single quotation marks '' or double quotation marks "". Both quotes represent Strings but be sure to choose one and STICK WITH IT. If you start with a single quote, you need to end with a single quote.







drupel menu add
home>Adminstration>structure>menu> add menu >main menu >add tile and description>save>path link>save


<\P>


drupal acuaia
content type
most of cms have mostly title and body but in drupal every content is a node
and each node belong to single content type , conatent type defines dafult setting for nodes.
it contols how content is addded in your site beacuse every content types have fields

text format : basic (list paragragh etc )restricted(paragragh line break ) fullhtml(all html tag and script )



joyti drupal traing part 1 notes
->project shuld done by composer
->composer is devleped by php community
->for insttaltion of pacakage composer require lock file and json file
->lock file use to record version for package
->composer abovd 2.0 does not need any plugin
-> if we do not need interaction then comand --no interaction --no install
->ceratin project rerquire depandencies
-> benifits of composer is it better know all files which are required for install of partical package
and their dependencies
->jason file conatins require section which conatin all depencies
->if cerain pakage is not required by in production then package is written as --no-dev
it means then name of package where dash dev (-dev) will be not shared for production it will only act
custom package for devloper.
-> to create project command is composer create-project drupal/recomnded-project kamproject i.e name of project
->carat sign^ in version function as the update for veriosn if not used then when update for version is done then
it will stick with existing version and version will not update
->all package all availble on https://packagist.org/
->if we habve not lock filer the composer will installl latest version this will creagte ambugity
among devloper because all devloper require same veriosn of package while working same project
this is benifits of lock file
->devloper of drupel wanted to name as drop but spellling mistake it was name drupel and drop icon
->gitignore: not sent file to git i.e our core package beacuse it is user defined and customer details
->never change any data in core
->jason file conatin version of each package , thus when update are vailble then verison are updated accodring to jason file
->libray samaj nahi aya




joyti drupal traing part notes
-> How to add js library
-> suppose we want to add slick library
first under repository we add slick which contains type and package
(package contain name version type AND source )
"slick " :{
"type":PACKAGE
"PACAKGE ":{
"NAME":
"TYPE":
"VERSION":

"source":{
"URL": GIT@GITHUB.COM
"TYPE":"GI"
"REFENCE":"2.0"
}
}
}


joyti drupal traing part notes
-> How to add js library
-> suppose we want to add slick library
first under repository we add slick which contains type and package
(package contain name version type AND source )
"slick " :{
"type":PACKAGE
"PACAKGE ":{
"NAME":"FULLSTACKTRAIN/SLICK",
"TYPE":"DRUOPAL-LIBRARY",
"VERSION":"1.1.0", IT IS ARBITARY

"source":{
"URL": "GIT@GITHUB.COM"
"TYPE":"GI"
"REFENCE":"2.0"
}
}
}

->COMMAD TO ADD A LIBRARY
COMPOSER REQUIRE FULLSTACK/SLICK
IT WILL ADD LIBRARY TO OUR REQUIRE MODULE


GIT HUB LOGIN
USERNAME: giga.kumar@gmail.com
password: giga@1234



git stages
when create files then it is untrack stage
then add files for tracking
then commit files
them modify files

git command practice

git init : start git make respository
git touch : generate empty file
git status : shows files (green means it is tracked) red menans not tracked
git add -A : means it make all files trackale and now we can perform operations
git commit -m "message" : make commit all files or upload
git checkout filename : makes files recovered on delete if file is deleted


joyti drupal traing part 1 notes
->project shuld done by composer
->composer is devleped by php community
->for insttaltion of pacakage composer require lock file and json file
->lock file use to record version for package
->composer abovd 2.0 does not need any plugin
-> if we do not need interaction then comand --no interaction --no install
->ceratin project rerquire depandencies
-> benifits of composer is it better know all files which are required for install of partical package
and their dependencies
->jason file conatins require section which conatin all depencies
->if cerain pakage is not required by in production then package is written as --no-dev
it means then name of package where dash dev (-dev) will be not shared for production it will only act
custom package for devloper.
-> to create project command is composer create-project drupal/recomnded-project kamproject i.e name of project
->carat sign^ in version function as the update for veriosn if not used then when update for version is done then
it will stick with existing version and version will not update
->all package all availble on https://packagist.org/
->if we habve not lock filer the composer will installl latest version this will creagte ambugity
among devloper because all devloper require same veriosn of package while working same project
this is benifits of lock file
->devloper of drupel wanted to name as drop but spellling mistake it was name drupel and drop icon
->gitignore: not sent file to git i.e our core package beacuse it is user defined and customer details
->never change any data in core
->jason file conatin version of each package , thus when update are vailble then verison are updated accodring to jason file
->libray samaj nahi aya





joyti drupal traing part notes
-> How to add js library
-> suppose we want to add slick library
first under repository we add slick which contains type and package
(package contain name version type AND source )
"slick " :{
"type":PACKAGE
"PACAKGE ":{
"NAME":
"TYPE":
"VERSION":

"source":{
"URL": GIT@GITHUB.COM
"TYPE":"GI"
"REFENCE":"2.0"
}
}
}



joyti drupal traing part notes
-> How to add js library
-> suppose we want to add slick library
first under repository we add slick which contains type and package
(package contain name version type AND source )
"slick " :{
"type":PACKAGE
"PACAKGE ":{
"NAME":"FULLSTACKTRAIN/SLICK",
"TYPE":"DRUOPAL-LIBRARY",
"VERSION":"1.1.0", IT IS ARBITARY

"source":{
"URL": "GIT@GITHUB.COM"
"TYPE":"GI"
"REFENCE":"2.0"
}
}
}

->COMMAD TO ADD A LIBRARY
COMPOSER REQUIRE FULLSTACK/SLICK
IT WILL ADD LIBRARY TO OUR REQUIRE MODULE

GIT HUB LOGIN
USERNAME: giga.kumar@gmail.com
password: giga@1234



git stages
when create files then it is untrack stage
then add files for tracking
then commit files
them modify files

git command practice

git init : start git make respository
git touch : generate empty file
git status : shows files (green means it is tracked) red menans not tracked
git add -A : means it make all files trackale and now we can perform operations
git commit -m "message" : make commit all files or upload
git checkout filename : makes files recovered on delete if file is deleted

<\P>

>
->Entiies type are useful abstraction to group fields
eg. noded ,user,media beacuse it encapsulate fields togethwer and contain entites
->any thing under structure is entity type and entities
->entity type>bundles>fileds> one entry is called entity
->enity type conatins bundles and buldle conatins fields or attribute . one entry of enity type is called enity
<\P


->display mode 1. default 2. rss 3. teaser
->adding new view mode: structure >Display modes >View modes >Choose view mode entity type
>give name of new view mode say card >say for enity type content we have added extra view mode
i.e card . we can navigate view mode i.e strucutre >display mode>view mode> list of view modes availbe
it contains our added view mode. In javascript, the behaviour of “this” keyword is based on how a function is called. “this” holds the reference to current execution context in javascript. Depending on how a function is called, this can refer to different objects.



In javascript, the behaviour of “this” keyword is based on how a function is called. “this” holds the reference to current execution context in javascript. Depending on how a function is called, this can refer to different objects.



this in java script
-> in which contect this comes
if this is defined in method then this has refence of owner object(comes under method owner oject context )
if this is defined in standlone then it has reference to window object (comes under winwod owner context )
in strice mode it is undefined . need to explict give this context i.e with whom object to bind




layout Builder
-> thumb rule for layout builder : use it for dynamic content not for static content
->Every thing in layout is a block
-> we need to enable layout builder by navigating manage > extend > enter . it will show no. of modeule avalibale
first we need to type layout in search bar and then enable check box ans then click install
when lay out get install then we navigate Home >Administration >Structure >Content types >Basic page>manage dispaly
> on page bottom >layout option >check box use lay out builder > all fields of basic page are removed and there appear
Manage Layout Buttion > click on manage layout button >add swection > two column >column width 50% 50% >then section is added with two blocks kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Team password kamalkumar@123 New mail id
Kamlendra.kr2020@gmail.com New mail id
Kamlendra.kr2020@gmail.com


JQUERY
->$(SELECTOR).ACTION();
->HIDE(),SHOW(),HTML(),RETUN TRUE means futher excecution of program/ false means stop excution of program
->length .submit()


$(document).ready(function(){
$("button").click(function(){alert("hellio o oo o ");});
});










class Fruit {
public $name;
public $color;
public function __construct($name, $color) {
$this->name = $name;
$this->color = $color;
}
protected function intro() {
echo "The fruit is {$this->name} and the color is {$this->color}.";
}
}

class Strawberry extends Fruit {
public function message() {
echo "Am I a fruit or a berry? ";
// Call protected method from within derived class - OK
$this -> intro();
}
}

$strawberry = new Strawberry("Strawberry", "red"); // OK. __construct() is public
$strawberry->message(); // OK. message() is public and it calls intro() (which is protected) from within the derived class

<\P>
{% if field_hide_learn_more_button == "Off" %}//unneck
{% set view_link = view_node %} url value
{% if field_learn_more_url is not empty %}
{% set target = 'target="_blank" ' %}
{% set view_link = field_learn_more_url %}
Learn More
{% endif %}

{% endif %}
{% if field_event_details_register_url %}
Register
{% endif %}

<\P>

% if field_hide_learn_more_button == "Off" %}
{% if field_learn_more_url is not empty %}
{% set view_link = field_learn_more_url %}
Learn More
{% endif %}
{% endif %} Functions and templates for the user interface that themes can override.

<\P>
https://api.hostdog.eu/api/drupal-9

https://www.drupal.org/docs/develop/standards/php/object-oriented-code


Drupal notes



-> entity types are two types 1. contentType ana 2. Configuration Type
-> Entity are themslves collection of fields
-> Entity Type API is made by TypeData API
-> Entity are plugins
->Fields are plugin called Fieldtype
-> configuration entites are made from configruration fields (cofig_entity (for complex) or config_object
(for simple configuration such as primitive values )
-> Entity API knows what type of data confuration entities hold by their schema defination.
-> FieldType are two type basefiled (part of content entity type and closed and store in base_table ) and config flied
->$fields['title'] = BasefieldDefinition::create('string ') // here string is configuration FieldType plugin
and title is base field
-> for making custom field type use drupal plugin called FieldType
-> cinfiguration entity use getter and setter method for its field but also rely on parent class
ConfigEntityBase class get() and set() method.






php oops notes




-> object 2 hi kaam karta hai 1. access to method (witin its scope ) 2. acces to property (within its scope )
-> kisi object ka method access scope 3 ho sakta hai. 1. self 2. parent 3. global
-> koi bhi class apne object ke through hi kaam karega





-> object 2 hi kaam karta hai 1. access to method (witin its scope ) 2. acces to property (within its scope )
-> kisi object ka method access scope 3 ho sakta hai. 1. self 2. parent 3. global
-> koi bhi class apne object ke through hi kaam karega
-> yadi koi class inferface ko implement nahi karta hai aur implenment method ko acces karta hai tab fatal error milga
-> yadi koi class interface ko implement kare aur khud se method ko define na kare to PHP Fatal error: Class salu contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ram::meet) in HelloWorld.php on line 25

-> first criteria class ko interface ke method ko ya to kud ke scope me define karna hoga ya bhir parent scope me define hona chaye
-> run time me interface object class object se replace ho jata hai
-> ab jitne bhi class ne particular interface ko implement kiya ab unsabka object asani se apne defined method (khud ya parent )
ko access kar sakta hai. Yaha hum dek sakte hai ki interface object ek common object ki tarah kaam karta hai aur ye concept use karke hum
commomn platform define kar sakte hai jaise ki common payment gate way jisko diffrent company use kar sakta hai . This is also principle of polymorphism
maan liye ek method hai dopayment() which is common for all payment app . It is such defined that any payment app can use this method means here interface object
is acting for all objects.
-> php.net ka point prove ho gaya ki diffrent class ko object create karne deta hai jo interchangle kiya ja sakta hai .
-> kaya hoga yadi interface ki jagah class object ko use kare . us condition me kerval ek it output milega jo class me define hoga . humo har time mehod defination ke liye
ek naya class banana hoga aur har class object ko paas karna hoga hamesa ek naya method me ise code be heavy hoga. Yadi kisi bhi class ne koi bhi mehod me override
kiya to pura program bhi corrupt ho sakta hai. Decoupling concept fail ho sakta hai. lakin interface ke case me aisa kuch bhi nahi hoga koyki method override claas ke
apne hi scope me rah jayega.
-> php.net ka dusra point bhi prove ho gaya ki interface object se method ko call kiya ja sakta hai with parameter.







interface ram{

public function meet();

}

class shyam implements ram {

public function meet()
{echo "jai siya ram";}

}

class sonu extends shyam {

public function meeting(ram $ramu)
{
if($ramu instanceof ram ){echo "interface object ";}
else {echo "not interface object ";}
}
}

class cat {}



$catu = new cat();
$hanu = new sonu();
echo $hanu->meeting($hanu);
echo $hanu->meeting($catu);




o/p

interface object// correct run program
PHP Fatal error: Uncaught TypeError: Argument 1 passed to sonu::meeting()
must implement interface ram, instance of cat given, called in HelloWorld.php on line 43 and defined in HelloWorld.php:19
Stack trace:
#0 /runtime/php/3zawfbc4j_3zaxu4xa4/HelloWorld.php(43): sonu->meeting()
#1 {main}
thrown in /runtime/php/3zawfbc4j_3zaxu4xa4/HelloWorld.php on line 19

Conclusion: 1. to use interface method class must implement interface
2. sonu claas ke object ne dono condition ko meet kiya .
(A). interface ko implement kiya via shyam class
(B). inteface method ko define kiya via shyam class .



-> ek function ko call karne ke liye humko ek object chaye .
-> dusra point function hamesa object ke scope me hona chaye (self parent or global scope )
->agar code me inteface object ke badle me dusra object jata hai to TypeError hoga wani wahi object accept hoga
jo interface ko implement karta hai aur uske paas interface method ka defination ho.
->The static keyword is also used to declare variables in a function which keep their value after the function has ended.
matlab function excecute hone ke baad bhi static variable me value rahega.
->php factory design me pahle object crete karte hai (by calling some create method) and then intilize object.
-> return $this matlab jis class ka object jo method ko call kar raha hai usi class ka object ko return kar diya jata hai.

class ram {
public function ravan(){
return $this;
}
}


$ne = new ram();
echo print_r($ne->ravan());

Output:



ram Object
(
)
1

To serialize data means to convert a value to a sequence of bits, so that it can be stored in a file, a memory buffer, or transmitted across a network.
$data = serialize(array("Red", "Green", "Blue"));
echo $data;
a:3:{i:0;s:3:"Red";i:1;s:5:"Green";i:2;s:4:"Blue";}
a means array
i means index
0 means 0 index
s means total no. of character
: seprartor for key value pair

-> validation by jquery
1. usercheck messaage genrally in a header tag
2. validation flag true or flase
3. if empty input then show usercheck and false signal from flag
4. if input data not meet condition then shoe usercheck with message and flag off
5. if all ok then make falg true and retun flag.
6. submit function works on this falg value is true then proceed and if faLSE then off


word meaning
in terms of grandeur (saan) the new parliment combines tradition with modernity - the imposing sandstone facade (mukauta)
peacock motif (aakriti) on high celings and intricately (jatil) carved wooden decor . the pm have impeccable (trutihin)sense
of timing in whatever he does .his eloquent (uttam boli) inaugral speech in parliament. his suppoter saw it as heralding (suchna dena) the arrival of hindustov epoch(yug) that sankar had propounded (stapit ) and modi had modi had embody (avtar lena ).intervening (beech) night of august 14 1947



the progenator (purva purush ) of bjp is sri vinayak damodar savarkar 28may 2023 is inugral date of new parialment and 140 bith annivarsrary vds -> jquery true means allow code or program to proceed futher matlab ye allow kar deta hai ki aage bado if return false ye program ko rok deta hai . ye return zero kata hai islye program ko pata hi nahi chalta hai ki kaya kare

The PHP fetch_assoc() function fetches the next row of a result set as an associative array in PHP mysqli object-oriented style.

Html and javascript me php ghusaya ka sakta hai
And php echo se html ya javascript output karaya ja sakta
Hai