This code is incredibly useful for going through an array and applying changes to the individual values without having to create a specific loop to perfom this action. In this example all apostrophes are escaped.
// Walk through the array and escape all apostophes (anonymous function) array_walk($merged_config, function(&$value, &$key) { $value = str_replace("'", "\\'", $value); });
this also works, without the &$key
// Walk through the array and escape all apostophes (anonymous function) array_walk($merged_config, function(&$value) { $value = str_replace("'", "\\'", $value); });
keep the '&' it is important. This creates a reference to the object in memory.
When testing the translation system on QWcrm I needed to try different locales (languages) to see if the software actually worked how it should. The following are ways to change the HTTP_ACCEPT_LANGUAGE header that the browser sends to the webhost with its request.
This will also fix the issue where Firefox was sending en-US instead of en-GB
Option 1 - Change the browser system settings
Option 2 - re install
You can also just install Firefox with the correct locale.
Option 3 - Plugins
Using a plugin will allow you to easily change the settings on a temporary basis.
Option 1 - Change the browser system settings
This is useful when you want to control the errors outputted tot he screen or is a class or some other code is not behaving as expected, such as the ADOdb error class.
The following code will preserve the current error reporting level so once your code has finished running the system's error reporting will be returned to its normal state.
// Get current PHP error reporting level $reporting_level = error_reporting(); // Disable PHP error reporting (works globally) error_reporting(0); // Add you code here // Re-Enable PHP error reporting error_reporting($reporting_level);
This needs to be cleared up for us newbies. and to start with you will come across the following statements which are both true.
Composer is not a package manager because you are not downloading complete software packages but dependencies/libraries for your own software package.
Composer is a cross-platform software package that can is used to manage libraries for your PHP software project allowing you to install, update and remove libraries/dependencies from a single point reducing the need to manually update all of the dependecies individually which reduces time and makes it easier to keep things upto date. composer calls on its own library to get the latest updates of the various depencies. A vendor of software can make their software available from this library for others to use.
It is composer of the program mentioned above to manage your dependecies and also a small library to control autoloading of classes and other things.
Composer is useful because some packages use mulitple dependancies to get them to work and composer allows you to always get the latest version of all of the packages, or specify package numbers for your project. This process also correctly sets up all the required includes up as needed. This can reduce the time needed to update all of the packages.
The Wonderful World of Composer - YouTube - This is brilliant video that will explain Composer completely.
require vendor/autoload.php
When using mPDF to generate a PDF from a template it renders one or more tables and the fonts within them smaller than what they are in the template.
Look at the code below:
<!-- Invoice details --> <td valign="top" align="right" width="200"> <table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse;"> <tr> <td valign="top" width="90%" align="right"></td> <td align="top" class="olotd5" width="200"> <table width="180" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse;"> <tr> <td> <b>{t}Invoice ID{/t} - </b>{$invoice_details.invoice_id}<br> <b>{t}Status{/t} - </b>{$workorder_details.status}<br> <b>{t}Date{/t} - </b>{$invoice_details.date|date_format:$date_format} <br> <b>{t}Due Date{/t} - </b>{$invoice_details.due_date|date_format:$date_format}<br> <b>{t}Work Order{/t} - </b>{$invoice_details.workorder_id}<br> <b>{t}Technician{/t} - </b>{$employee_details.display_name}<br> <b>{t}Credit Terms{/t} - </b>{$customer_details.credit_terms}<br> </td> </tr> </table> </td> </tr> </table> </td>
and you can see this line.
<td valign="top" width="90%" align="right"></td>
mPDF cannot handle this empty cells with sizing statements.
I removed this line and then the template was rendered correctly.
These are some notes I made while integrating dhtmlxCombo into QWcrm.
<script src="/{$theme_js_dir}dhtmlxcombo/dhtmlxcombo.js"></script> <link rel="stylesheet" href="/{$theme_js_dir}dhtmlxcombo/fonts/font_roboto/roboto.css"/> <link rel="stylesheet" href="/{$theme_js_dir}dhtmlxcombo/dhtmlxcombo.css">
Example code I used in QWcrm
// This Call Transforms the Select Element by ID to a real Combo Box var combo = dhtmlXComboFromSelect('description['+ iteration+']'); // This Call Transforms the Select Element by ID to a real Combo Box var combo = dhtmlXComboFromSelect('rate['+ iteration+']');
var combo = dhtmlXComboFromSelect('rate['+ iteration+']'); combo.setSize(90); // This sets the width of the combo box and drop down options width //combo.setOptionWidth(200); // this sets the width of the options drop down ONLY
These are my note for Keep a Changelog
Version Number Links
The links on the version number [1.0.0] will not work unless they have the corresponding link below i.e.
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD [1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0 [0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0
Option 1
This is an example blockquote.
<div style="text-align: center;"> <blockquote style="display: inline-block; width: 200px;">This is an example blockquote.</blockquote> </div>
Option 2
This is an example blockquote.
<div style="text-align: center;"> <blockquote style="display: inline-block; max-width: 450px;"> <p>This is an example blockquote.</p> </blockquote> </div>
Option 3
This is an example blockquote.
<blockquote style="display: table; max-width: 450px; margin: 0 auto;">This is an example blockquote.</blockquote>
These width settings work aswell:
These ar the absolute basic instructions I give out to client who insist on editing their website.
Hi Client,
Here are the details for editing the website.
Your website is powered by WordPress that uses the Divi builder by elegant themes.
Help Sources
How to get to a page and edit it (quick start)
Thanks
QuantumWarp