This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getSettingsFieldsMap($providerName, $moduleName) | |
{ | |
Yii::import('application.modules.' . $moduleName . '.models.' . $providerName); | |
$reflection = new ReflectionClass($providerName); | |
$instance = $reflection->newInstanceWithoutConstructor(); | |
return $instance->getAttributeConfig(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function fetchSearchName($item) | |
{ | |
// bp_prad_kli_id | |
$this->log(gettype($item['searchName'])); | |
$this->log($item); | |
if (gettype($item['searchName']) == 'object') { | |
if ($item['name'] === 'clientName') { | |
return 'kli_pav'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openClientInvoices(templateUrl, clientId) { | |
return $uibModal.open({ | |
// templateUrl: util.buildUrl('warehouse/sales', {clientId: clientId}), | |
templateUrl: util.buildUrl('resource/partials/modal', {clientId: clientId}), | |
controller: function ($uibModalInstance, templateUrl) { | |
var c = this; | |
c.templateUrl = templateUrl; | |
c.dismiss = function () { | |
$uibModalInstance.dismiss('close'); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Controller | |
angular.module('b1').controller('WarehousePurchaseEdit', function (){ | |
c.onPurchaseDateChange = function (param) { | |
alert(param); | |
} | |
} | |
//View |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('b1').directive("extOnChanges", function ($translate) { | |
return { | |
restrict: 'A', | |
link: function (scope, elem, attrs) { | |
elem.on('click', function() { | |
alert('You clicked me!'); | |
// elem.html('You clicked me'); | |
}); | |
elem.on('mouseenter', function() { | |
elem.css('background-color', 'yellow'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//controller | |
angular.module('b1').controller('WarehousePurchaseEdit', | |
function () { | |
c.onPurchaseDateChange = function () { | |
alert(c.oldPurchaseDate); | |
} | |
)}; | |
//view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Controller: | |
$dataProvider=new CActiveDataProvider('Comment', array( | |
'criteria'=>array( | |
'with'=>'post', | |
'order'=>'t.status, t.create_time DESC', | |
), | |
)); | |
$this->render('index',array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$criteria = new CDbCriteria(); | |
$criteria->select = 't.id, t.email'; | |
$criteria->order = 't.created_at'; | |
$criteria->condition = "t.status in (:s1, :s2) AND t.created_at >= :f AND t.created_at <= :u"; | |
$criteria->params = [ | |
':s1' => Users::STATUS_VERIFIED_INCOMPLETE, | |
':s2' => Users::STATUS_VERIFIED_COMPLETE, | |
':f' => $date->format('Y-m-d 00:00:00'), | |
':u' => $date->format('Y-m-d 23:59:59'), | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://slides.silverfire.me/2016/yii-di/#/1 | |
Компонент нужен тогда, когда: | |
Класс может быть предварительно сконфигурирован | |
Класс актуален в течение всего runtime | |
Хочется сделать singleton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Если исключаем папку например ajax обязательно указать | |
/ajax | |
чтобы брало от корня. | |
Если указать просто ajax - исключит изо всех подпапок по всему сайту этоу папку. | |
2. Исключить папку bitrix, но оставить подпапку aspro_max внутри. | |
/bitrix/* | |
!/bitrix/templates/ |