Перейти к содержимому


Фотография
- - - - -

Обработка плагинами input возможно?


Лучший Ответ CB9TOIIIA , 05 September 2016 - 13:45

В общем пашет 100%

  1. public function hasValue($params = array()) {
  2. $value = $this->get('value');
  3. return !empty($value);
  4. }
  5.  
  6. public function render($params = array()) {
  7. $value = $this->get('value');
  8. $result = $this->app->zoo->triggerContentPlugins($value, array('item_id' => $this->_item->id), 'com_zoo.element.textarea');
  9. return $result;
  10. }
  11.  

Magic

Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 14

#11 SmetDenis

SmetDenis

Отправлено 05 September 2016 - 10:27

CB9TOIIIA сказал(а) 05 Сен 2016 - 09:23:

ничего

Даже если die('Opa') вставить в плагине?

 

 

 Кстати, вместо "com_zoo.element." лучше написать как у textarea "com_zoo.element.textarea"


  • 1
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#12 CB9TOIIIA

CB9TOIIIA

Отправлено 05 September 2016 - 10:43

В общем код такой:

  1.  
  2. public function hasValue($params = array()) {
  3. $value = $this->get('value');
  4. return !empty($value);
  5. }
  6.  
  7. public function render($params = array()) {
  8.  
  9. $value = $this->get('value');
  10. $result = $this->app->zoo->triggerContentPlugins($value, array('item_id' => $this->_item->id), 'com_zoo.element.textarea');
  11. dump($result,0,'$result');
  12. return $result;
  13.  
  14. } 

Если удалить onContentPrepare или же вставить return '1111'

 

Будет:

 

0_a7510_b23696ee_orig.png

 

Если вернуть родной onContentPrepare 

 

0_a7511_60c0c6d5_orig.png

 

На die('Opa')  рушит страницу.

 

0_a7512_3e1e46c6_orig.png


Сообщение отредактировал CB9TOIIIA: 05 September 2016 - 10:46

  • 0

#13 fiction13

fiction13

Отправлено 05 September 2016 - 11:04

Глупо такое предполагать, но плагин-то включен?

 

Данная конструкция работает и не дает повода сомневаться. Недавно ее использовал, не только в элементах, но и в категориях, итемах.


  • 0

#14 CB9TOIIIA

CB9TOIIIA

Отправлено 05 September 2016 - 11:06

Работает - я же в плагине изменения делал - результаты разные
  • 0

#15 CB9TOIIIA

CB9TOIIIA

Отправлено 05 September 2016 - 13:45   Лучший Ответ

В общем пашет 100%

  1. public function hasValue($params = array()) {
  2. $value = $this->get('value');
  3. return !empty($value);
  4. }
  5.  
  6. public function render($params = array()) {
  7. $value = $this->get('value');
  8. $result = $this->app->zoo->triggerContentPlugins($value, array('item_id' => $this->_item->id), 'com_zoo.element.textarea');
  9. return $result;
  10. }
  11.  

Magic


  • 2




Click to return to top of page in style!