cakephp

CakePHP Media Plugin Issue - undefined method MIME_Type::config()

蓝咒 提交于 2020-01-07 03:15:26
问题 I am using the Media plugin by David Persson for CakePHP (https://github.com/davidpersson/media). I've placed the files in app/plugins/media and added require APP . 'plugins/media/config/core.php'; to my app's core.php, but when I run cake media init I get this error: Fatal Error: Call to undefined method MIME_Type::config() in C:\xampp\htdocs\wompwomp\app\plugins\media\config\core.php on line 166 Any idea what's happening here? Can I just make the directories manually? If so, what are the

CakePHP hiding action name in URL, while passing arguments

南楼画角 提交于 2020-01-07 02:34:45
问题 I have such a structure: example.com / MyController / index / MyGoodPage / maximum/ example.com / MyController / index / MyBestPage / optimum/ example.com / MyController / index / MyFancyPage / lowprice/ But I don't want my visitors to see "index" word, because it doesn't give any more information to him/her. I need my URLs like this: example.com / MyController / MyGoodPage / maximum/ example.com / MyController / MyBestPage / optimum/ example.com / MyController / MyFancyPage / lowprice/ But

How to display results from a result set in CakePHP?

非 Y 不嫁゛ 提交于 2020-01-07 02:18:12
问题 I have the following codes, I added the debug and this is the data that I am able to retrieve from the database. I wish to display the ['User']['firstName'] and also the ['Passion']['passion_tag'] in the view page, how do I do it? I am facing error such as: Notice (8): Undefined index: passion_tag [APP\views\searches\simple_search.ctp, line 127] [5] => Array ( [User] => Array ( [id] => 41 [password] => 2b4a3cf55ddf9b15e161aeba3540a75ddd6ea872 [firstName] => Ming Xin [lastName] => Toh [email]

how to categorise or group array by date

瘦欲@ 提交于 2020-01-06 20:35:22
问题 I have a list of history which is grouped by date DESC like this: ----------- 28/Feb/2014 ----------- 27/Feb/2014 ----------- 27/Feb/2014 ----------- 27/Feb/2014 ------------ 26/Feb/2014 ------------ 26/Feb/2014 I want to be printed like this. ----------- 28/Feb/2014 ----------- 27/Feb/2014 27/Feb/2014 27/Feb/2014 ------------ 26/Feb/2014 26/Feb/2014 here is my array: array( (int) 0 => array( 'BriefHistory' => array( 'id' => '2', 'created' => '2014-02-28 14:51:08', 'created_by' => '7827',

how to categorise or group array by date

时光总嘲笑我的痴心妄想 提交于 2020-01-06 20:35:21
问题 I have a list of history which is grouped by date DESC like this: ----------- 28/Feb/2014 ----------- 27/Feb/2014 ----------- 27/Feb/2014 ----------- 27/Feb/2014 ------------ 26/Feb/2014 ------------ 26/Feb/2014 I want to be printed like this. ----------- 28/Feb/2014 ----------- 27/Feb/2014 27/Feb/2014 27/Feb/2014 ------------ 26/Feb/2014 26/Feb/2014 here is my array: array( (int) 0 => array( 'BriefHistory' => array( 'id' => '2', 'created' => '2014-02-28 14:51:08', 'created_by' => '7827',

cakephp find('list') for select box

北城余情 提交于 2020-01-06 20:23:46
问题 I am trying to implement selectbox in my site.Option for that selectbox is set in my controller like below $tmp_user = $this->User->find('first',array('id'=>$this->Auth->user('id'))); $zip_info = $this->Zipcode->find('first',array('id'=>@$tmp_user['User']['zip_id'])); $region_admins = $this->AdminRegion->find('all',array('conditions'=>array('AdminRegion.region_id'=>@$zip_info['Zipcode']['region_id']))); if(!empty($region_admins)){ foreach($region_admins as $radmn): //pr($radmn); $admin_user =

Cakephp unable to send email

試著忘記壹切 提交于 2020-01-06 20:12:55
问题 I want to use the cakePHP mailer system, but I am unable to send an email, I get the following error: Fatal error: Class 'CakeEmail' not found in D:... on line 100 I have the following defined in my controller: App::uses('AppController', 'Controller','CakeEmail', 'Network/Email'); // In the controller: public function search() { $email = new CakeEmail(); $email->from(array('noreply@assetchase.co.za' => 'Assetchase.co.za')); $email->subject('result notification.'); foreach($emails as $value) {

CakePHP 3 Display Colleges owned by Admins

柔情痞子 提交于 2020-01-06 19:35:21
问题 I have two tables colleges and college_admins. Each College is owned by a CollegeAdmin who is a User. I'm using the Auth component to authorize access to which pages can be viewed by which user. Now, I want to each CollegeAdmin to list only Colleges owned by him / her. This is what I'm doing in the CollegesController: public function index() { $this->set('colleges', $this->paginate($this->Colleges->ownedBy($this->Auth->user('id')))); $this->set('_serialize', ['colleges']); } And this is the

Containable and deep associated data

走远了吗. 提交于 2020-01-06 19:12:31
问题 document has many document_item document_item has many document_item_description and belongs to document document_item_description has one document_item I'm trying to get a document with all document_items and all associated document_item_descriptions for the associated document_items Is there a way to do this? Right now all I can get are document_items but can't get down to the third level. class Document extends AppModel { public $hasMany = array( 'Document_item' => array( 'className' =>

Containable and deep associated data

穿精又带淫゛_ 提交于 2020-01-06 19:11:18
问题 document has many document_item document_item has many document_item_description and belongs to document document_item_description has one document_item I'm trying to get a document with all document_items and all associated document_item_descriptions for the associated document_items Is there a way to do this? Right now all I can get are document_items but can't get down to the third level. class Document extends AppModel { public $hasMany = array( 'Document_item' => array( 'className' =>