Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]link w kodzie
kbilski
post
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 16.04.2010

Ostrzeżenie: (0%)
-----


Witam

Jak to zamienić żeby fraza returns (lub exchange in store itd) lub zdjęcie (reinsurance-1-1.jpg) zrobić jako link?


  1. public function installFixtures()
  2. {
  3. $return = true;
  4. $tab_texts = array(
  5. array('text' => $this->l('Returns'), 'file_name' => 'reinsurance-1-1.jpg'),
  6. array('text' => $this->l('Exchange in-store'), 'file_name' => 'reinsurance-2-1.jpg'),
  7. array('text' => $this->l('Paypal & Credit Card'), 'file_name' => 'reinsurance-3-1.jpg'),
  8. array('text' => $this->l('Fast Delivery'), 'file_name' => 'reinsurance-4-1.jpg'),
  9. array('text' => $this->l('Paypal 100% secured payment'), 'file_name' => 'reinsurance-5-1.jpg')
  10. );
  11.  
  12. foreach($tab_texts as $tab)
  13. {
  14. $reinsurance = new reinsuranceClass();
  15. foreach (Language::getLanguages(false) as $lang)
  16. $reinsurance->text[$lang['id_lang']] = $tab['text'];
  17. $reinsurance->file_name = $tab['file_name'];
  18. $reinsurance->id_shop = $this->context->shop->id;
  19. $return &= $reinsurance->save();
  20. }
  21. return $return;
  22. }
  23. }
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kbilski
post
Post #2





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 16.04.2010

Ostrzeżenie: (0%)
-----


  1. <?php
  2.  
  3.  
  4. class reinsuranceClass extends ObjectModel
  5. {
  6. /** @var integer reinsurance id*/
  7. public $id;
  8.  
  9. /** @var integer reinsurance id shop*/
  10. public $id_shop;
  11.  
  12. /** @var string reinsurance file name icon*/
  13. public $file_name;
  14.  
  15. /** @var string reinsurance text*/
  16. public $text;
  17.  
  18.  
  19. /**
  20. * @see ObjectModel::$definition
  21. */
  22. public static $definition = array(
  23. 'table' => 'reinsurance',
  24. 'primary' => 'id_reinsurance',
  25. 'multilang' => true,
  26. 'fields' => array(
  27. 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true),
  28. 'file_name' => array('type' => self::TYPE_STRING, 'validate' => 'isFileName'),
  29. // Lang fields
  30. 'text' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true),
  31. )
  32. );
  33.  
  34. public function copyFromPost()
  35. {
  36. /* Classical fields */
  37. foreach ($_POST AS $key => $value)
  38. if (key_exists($key, $this) AND $key != 'id_'.$this->table)
  39. $this->{$key} = $value;
  40.  
  41. /* Multilingual fields */
  42. if (sizeof($this->fieldsValidateLang))
  43. {
  44. $languages = Language::getLanguages(false);
  45. foreach ($languages AS $language)
  46. foreach ($this->fieldsValidateLang AS $field => $validation)
  47. if (isset($_POST[$field.'_'.(int)($language['id_lang'])]))
  48. $this->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])];
  49. }
  50. }
  51. }
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 04:19