Research and Findings. - Libbna/CUSTOM-CMS GitHub Wiki
This page contains all the research and findings done by the contributors.
04th January 2022 (Tuesday)
Libbna -
- libraries for crud operations:
17th December 2021 (Friday)
Libbna -
- for creating regions in our local project we can follow 2 approaches.
- https://befused.com/drupal/twig-child-new-region/ ----- we can do just like drupal, how the regions are created and parent & child templates are rendered - we can do this only if it is possible in non-drupal site -- need to do more research on it .
- or we can create different sections like wrappers which can act like REGIONS. - Using semantic tags.
16th December 2021 (Thursday)
Ruturaj -
- Researched on a symfony component to replace the use of PHP superglobals in the custom-cms.
- During this research came across the Symfony httpfoundation component. Symfony HttpFoundation Component
14th December 2021 (Tuesday).
Ruturaj -
- Researched on rendering image in search result page.
- Went through some modules like Search API Page .
- Finally, was able to render image via overriding search-result.html.twig file.
Libbna
-
Why no closing PHP tag in files containing only PHP?
- It is a good universal rule not using closing tag in php scripts. Note that everything after that closing tag is sent to client (browser) even white characters so if you're using closing tag and new line or any other white character it will be sent to browser. In most cases this behaviour is not desirable.
- php closing tag should be omitted because of the occurrences of accidental white spaces or new lines after php closing tag, which may start output buffering. REF:
-
REFLECTION CLASS?
- The ReflectionClass class reports information about a class. https://www.php.net/manual/en/class.reflectionclass.php
- Reflection provides information about the modifiers of a class or interface—whether that class is final or static, for example.
It can also reveal all the methods and data members of a class and all the modifiers applied to them.
Parameters passed to methods can also be introspected and the names of variables exposed. Through reflection it is possible to automate the documentation of built-in classes or user-defined classes. https://stackoverflow.com/questions/6724660/what-are-the-reflection-classes-in-php
Example: _ Reflecting an alias will give you a reflection of the resolved class._
<?php
class X {
}
class_alias('X','Y');
class_alias('Y','Z');
$z = new ReflectionClass('Z');
echo $z->getName(); // X
10th December 2021 (Friday).
Ruturaj -
- Researched about alternate ways to pull updates in feature branch from the newly updated master branch.
- Referred this document : here.
Libbna ~
- RnD on how to add a placeholder in a search input field in drupal.
- https://www.drupal.org/forum/support/module-development-and-code-questions/2014-01-28/editing-adding-placeholder-to-search -->
- https://drupal.stackexchange.com/questions/207628/how-can-i-change-the-search-form-placeholder-value/253292
- the above links are helpful in achieving to add placeholder in search field. To be more specific, add this function in your THEME.theme file
function yourtheme_form_search_block_form_alter(&$form, &$form_state) {
$form['keys']['#attributes']['placeholder'][] = t('enter the terms you wish to search for');
}
.
Vivek -
- Researched on defining regions