Db::getInstance()->méthodes
<?php /** * Sanitize data which will be injected into SQL query * * @param string $string SQL data which will be injected into SQL query * @param bool $htmlOK Does data contain HTML code ? (optional) * @return string Sanitized data */ pSQL($string, $htmlOK);
Ou bqSQL() :
bqSQL() can also be used. Note that besides escaping the ` character, it also calls pSQL() afterwards, but without the option to sanitize HTML.
$context = Context::getContext(); echo 'ID customer : '. $context->customer->id;
Ne pas faire :
require_once(_PS_MODULE_DIR_.'/projets/projets.php');
Mais plutôt :
$projets = Module::getInstanceByName('projets');
Fonctions utiles pour dev :
http://nemops.com/prestashop-functions-1/#.Vb8upPnzrmg
$this->context->cookie->id_lang //Lang ID $this->context->customer->id_lang // Probably better than the above