Yii Framework Forum: Media Directory As Parameter - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Media Directory As Parameter Rate Topic: -----

#1 User is offline   roadrunner 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 76
  • Joined: 21-June 12

Posted 17 January 2014 - 01:17 AM

Hi lets say i have loop that list all my media file in certain dir... I prefer to save all my media into database, that is saving all my images location. now in my situation i already list my media, like this
	 	$media=glob($_POST['id']."*.*");
		$j;	 
		for($i=0;$i<count($media);$i++){
		$image=$media[$i];
		$j=$i+1;
		echo "<tr>";	
		list($width, $height,$date)=getimagesize(getcwd().'/'.$image);
		$myext=getimagesize($image);
		$basename=basename($image);
		
		echo "<td><h6>".$j."</h6></td>";
		echo "<td><div style='width:50px;overlay:hidden'>".CHtml::image("/".$image)."</div></tD><td>".CHtml::link($basename,array('/media/media_details/create','params'=>$image))."</td><td>".$width." x ".$height."</td></td>";
		echo "<td>".$myext['mime']."</td></tr>";

		}
		echo "</table>";


see the params in my CHTML::link i want the $image(contains the media locations) to pass as a parameter to other controller(crud) to add additional description to media before saving to database together with its description in image.. any better idea how to do it or better approach..
In every problem there is more than possible answer! mjwebsolutions.net
0

#2 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 17 January 2014 - 05:44 AM

Hi

It is preferable to do it in component instead Controller.
Make a component method that save all desired info to database.

If these info belongs to related model you can create model method instead component method.
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users