Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. class Post extends AppModel {
  2. public $actsAs = array('Containable');
  3.  
  4. array(
  5. (int) 0 => array(
  6. 'Post' => array(
  7. 'id' => '1',
  8. 'title' => 'This is the first post',
  9. 'slug' => 'this-is-the-first-post',
  10. 'body' => 'body body 111body body 111body body 111body body 111body body 111body body 111body body 111',
  11. 'image_id' => '0',
  12. 'language' => 'sv',
  13. 'translation_id' => '0',
  14. 'created' => '2012-09-03 17:45:57',
  15. 'modified' => '2012-09-03 19:12:21'
  16. ),
  17. 'Image' => array(
  18. 'id' => null,
  19. 'name' => null,
  20. 'url' => null,
  21. 'alt' => null,
  22. 'description' => null
  23. ),
  24. 'Asset' => array(),
  25. 'Readmore' => array(),
  26. 'Reference' => array(),
  27. 'Category' => array(),
  28. 'Course' => array(),
  29. 'Tag' => array(),
  30. 'User' => array(
  31. (int) 0 => array(
  32. 'password' => '*****',
  33. 'id' => '2',
  34. 'username' => 'test0',
  35. 'fullname' => 'Test Test',
  36. 'url' => '',
  37. 'email' => '',
  38. 'role' => 'admin',
  39. 'phone' => '+',
  40. 'created' => '2012-09-03 17:44:22',
  41. 'PostsUser' => array(
  42. 'id' => '1',
  43. 'post_id' => '1',
  44. 'user_id' => '2'
  45. )
  46. ),
  47. (int) 1 => array(
  48. 'password' => '*****',
  49. 'id' => '1',
  50. 'username' => 'test1',
  51. 'fullname' => 'Frank',
  52. 'url' => '',
  53. 'email' => '',
  54. 'role' => 'admin',
  55. 'phone' => '',
  56. 'created' => '2012-09-03 17:41:25',
  57. 'PostsUser' => array(
  58. 'id' => '3',
  59. 'post_id' => '1',
  60. 'user_id' => '1'
  61. )
  62. )
  63. )
  64. ),
  65.  
  66. echo h($post['Post']['title']);
  67.  
  68. echo h($post['User']['fullname']);
  69.  
  70. echo h($post['User'][0]['fullname']);
  71.  
  72. <?php
  73. foreach($post['User'] as $user) {
  74. echo h($user['fullname']);
  75. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement