Category Covered

cakephp image upload  

In your view file use code like the example <?php echo $this->Form->create('Category',array('type' => 'file')); echo $this->Form->input('catimg', array("type"=>"file")); echo $this->Form->end(__('Submit', true)); ?>   In your controller file use the following code $this->Thumbpostcard  = new ThumbpostcardComponent();
$Coupon_file =  $this->Thumbpostcard->gene  
By: Tech writer  |   Total Read: 2449  |   Read more..

call one function from one controller to another in cakephp  

For example you have two controller named "contents" and "comments". And you have a function on comments controller that you want to use on contents controller.

$returnResult = $this->requestAction('comments/myaction/'.$parameters);

or

$this->loadModel('Comment');
$cart = $this->Content->Comment->myaction();  
By: Tech writer  |   Total Read: 883  |   Read more..

how can i get the cakephp controller and action name  

You can get the controller and action name from url very simply. To get the controller and action name use the bellong line on your controller or action   echo $this->params['controller'] //It will print the controller name   echo $this->params['action']  // it will print the action name  
By: Tech writer  |   Total Read: 849  |   Read more..
Top 15 Posts
Google+