Welcome Guest, Not a member yet? Register   Sign In
Hello world tutorial
#31

[eluser]TWP Marketing[/eluser]
On this new question, did you check the file permissions on the uploaded images? Are reading them allowed?
#32

[eluser]Aken[/eluser]
1) $data will never be a variable in the view unless you set it in the $data array as $data['data'] = 'something'; Variables that are accessible to the view are ones that A) you pass through using the data array, which then goes through the extract() function, B) you supply using $this->load->vars() somewhere other than your view, or C) the $this pseudo-variable.

2) You are not returning your $images array in your get_images() model method.
#33

[eluser]downah[/eluser]
Interesting question, after checking up on it yep reading is allowed, and the Please upload an image still shows as well which is weird. anyone else?
#34

[eluser]downah[/eluser]
PS I have been returning images, my apologies

Code:
foreach ($files as $file){
   $images[] = array(
    'url' => $this->gallery_path_url . $file,
    'thumb_url' => $this->gallery_path_url . 'thumbs/' . $file,
   );
   return $images;
  }
#35

[eluser]downah[/eluser]
[quote author="Aken" date="1344060732"]1) $data will never be a variable in the view unless you set it in the $data array as $data['data'] = 'something';[/quote]

So what does this mean, it doesn't make sense to me at the slightest, put $data in $data array as ['data']? ..

Thanks
#36

[eluser]skunkbad[/eluser]
[quote author="downah" date="1344073748"][quote author="Aken" date="1344060732"]1) $data will never be a variable in the view unless you set it in the $data array as $data['data'] = 'something';[/quote]

So what does this mean, it doesn't make sense to me at the slightest, put $data in $data array as ['data']? ..

Thanks[/quote]

If in your view you want to use a variable named $something, then you can get $something to exist by doing one of two things.

Code:
// 1)
$view_data['something'] = 'whatever';
$this->load->view('some/view', $view_data);

// 2)
$arr = array('something' => 'whatever');
$this->load->vars($arr);

Notice that in example #1 the value of $view_data is not accessible in the view, but the key named "something" is as $something. I think that's what Aken was trying to convey.
#37

[eluser]vimrul Indur[/eluser]
Wow .. Awesome post.
thank you aken

http://www.trademarkgolf.net/




Theme © iAndrew 2016 - Forum software by © MyBB