jQuery(function () {
let $ = jQuery;
$("a", $(".goroda")).each( function () {
let $this = $(this);
let path = window.location.pathname;
$this.attr("href", $this.attr("href") + path.substr(1) );
} );
})
class A {
/**
* A constructor.
* @throws Exception
*/
public function __construct()
{
// $cnt откуда-то берется...
$cnt = 0;
if ( $cnt < 1 ) {
throw new Exception("нулевое количество");
}
}
}
class B {
private $errors = array();
public function run()
{
try {
$a = new A();
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
return array("errors"=>$this->errors);
}
}
class A {
/**
* A constructor.
*/
public function __construct()
{
}
/**
* @throws Exception
*/
public function init()
{
// $cnt откуда-то берется...
$cnt = 0;
if ( $cnt < 1 ) {
throw new Exception("нулевое количество");
}
}
}
class B {
private $errors = array();
public function run()
{
try {
$a = new A();
$a->init();
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
return array("errors"=>$this->errors);
}
}
$arr = [685 => [
'id' => 685,
'title' => 'Комплектующие к Apple',
'parent' => 0
],
691 => [
'id' => 691,
'title' => 'Запчасти к iPad',
'parent' => 685
],
692 => [
'id' => 692,
'title' => 'Запчатси к iPhone',
'parent' => 681
]
];
location /resources/ {
alias /srv/web/split/storage/markets/$host/;
}
AjaxFormRequest('result_id', 'f01', 'mail_to.php')
$res = mysql_query("SELECT model FROM tech WHERE tech_cat='{$cat_id}'");
$models = array();
while ( $row = mysql_fetch_assoc($res) ) {
$models[] = $row['model'];
}
print_r($models);
print_r(array_count_values($models));
<?
// это строчки - обычный набор для отдельной аяксовой страницы;
// тут исключен вывод шаблона сайта (хедера и футера), только рабочая область
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>
// сюда закидывается вызов компонента списка новостей с исходной страницы
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>