cakephp-1.3

cake php 1.3? Can I Use any model in any controller and views?

喜欢而已 提交于 2019-12-12 01:53:51
问题 My question is that with example. I have to show all categories of books and with checkboxes in a page which I want to be posted to next view without interacting db and there I want to store them in a hidden field in a comma separated string. Actually I have a tab for find a book. user clicks on it and it has a list of categories of books listed which I get from categories model and used categories controller index function. I want to post user selected categories to next view like where I

CakePHP question: How can i upgrade a cakephp project from cakephp-1.3.10 to cakephp-1.3.11?

旧时模样 提交于 2019-12-12 01:27:21
问题 I have developed a project with cakephp-1.3.10 . Now I want to upgrade it to cakephp-1.3.11. What's the easiest process to upgrade from cakephp-1.3.10 to cakephp-1.3.11 ? 回答1: download the cake zip, unpack, delete the app folder, put your app folder in. 回答2: I'm sure you can't use composer! And there's a high cost in upgrading by a large jump between versions, meaning that you will end up with a lot of deprecated code. I would go like: complete backup upload your app to a Github repository

CakePHP 1.3 Media view not downloading ZIP file correctly

孤人 提交于 2019-12-11 19:42:27
问题 I recently migrated my site from CakePHP 1.1 to 1.3. I am now using media view to download files, however, I have a major problem. When I download a zip file through media view, and try to extract it, windows claims the file is empty. If I try to preview it, it says it is invalid. The file size is correct, same size as on server I can download the exact same file from the server via FTP, and it is correct I can download a pdf file through media view, and IT works correctly (but ZIP files do

cakePHP Session expiring too soon

送分小仙女□ 提交于 2019-12-11 18:19:39
问题 I have set Configure::write('Security.level', 'medium'); to low, set Configure::write('Session.timeout', '120'); to higher numbers, and in cake/libs/security.php I have set the inactiveMins() function to the following, function inactiveMins() { switch (Configure::read('Security.level')) { case 'high': return 10; break; case 'medium': return 100; break; case 'low': default: return 550; break; } } But sessions are still expiring at around 120 minutes. This is a time tracking app so I would like

CakePHP multi-HABTM associations with pagination

爱⌒轻易说出口 提交于 2019-12-11 17:54:01
问题 For an e-commerce app that I'm building I am using CakePHP. I have created the db and afterwards baked my app with cake bake . My models are all linked up properly as follows: Product hasMany CategoryProduct,ImagesProduct Category hasMany CategoryProduct CategoryProduct belongsTo Product,Category Image hasMany ImagesProduct ImagesProduct belongsTo Product,Image I have tried in various ways to obtain a paginated view of products dependent of the category_id with no succes. I have managed to

Run a cron job in cakephp

孤者浪人 提交于 2019-12-11 17:16:55
问题 I would like to write a cron job that has to run a PHP script at 6am, 11am,2pm,4pm on each day. Can you please help me with this? I wrote a shell task in shells and I want to run that task at the timings i said in the earlier statement. Thanks. 回答1: Link from CakePHP's book on this issue: http://book.cakephp.org/2.0/en/console-and-shells/cron-jobs.html (older version of the docs): http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs 回答2: you can set cron job like this in cakephp. 0 *

JQUERY: Add more item when insert new data

北战南征 提交于 2019-12-11 16:08:36
问题 I am developing the app using CakePHP 1.3 Now I want to make the "Insert function" to add new user into database. I have 2 fields user & pass to insert. But I not only insert 1 user, I want insert one or multiple user (optional). If I want to add more user I will click to "add more" to add new field in view. In cakephp, it required when we want to insert a array with multiple data. The field name will be define as: <?php echo $this->Form->input('Modelname.0.fieldname'); echo $this->Form-

CakePHP Error: Call to a member function parseAccept() on a non-object

吃可爱长大的小学妹 提交于 2019-12-11 13:19:27
问题 I have just upgraded from CakePHP 1.3 to cakePHP 2.4.5 . I am getting the following error: Fatal Error Error: Call to a member function parseAccept() on a non-object File: /myapp/lib/Cake/Controller/Component/RequestHandlerComponent.php Line: 157 I'm not calling the function parseAccept() anywhere within my controller, and so don't understand why I am getting this error. 回答1: From the Cake Manual Controller’s constructor now takes two parameters. A CakeRequest, and CakeResponse objects. These

if then else to display 2 views on one function called

喜夏-厌秋 提交于 2019-12-11 12:59:50
问题 i have got a little problem with redirect function, I have a controller function named "someview" and I also created a view file of the same name (someview.ctp) The controller function will do some stuff(query data from the model). it can be simply described as follows function someview() { $result=$this->User->getdatafrommodel(); if(null!=$result) { //do something } else { $this->redirect('usernotexist'); } } function usernotexist() { $this->loadSkin(); } I also created a page named

cakephp 1.3, how to use Paginator->sort() for two columns?

被刻印的时光 ゝ 提交于 2019-12-11 11:58:05
问题 i have a simple application where i view some posts from a database and i use Paginator->sort to sort. What i did is i duplicate everything so that i show the posts twice as well as the sorting. something like this: link_sort post1 post2 post3 link_sort post1 post2 post3 But when i click link_sort both post display get sorted, and i could see that because they are the same. But how can i make it unique so that one link sorts one post display and another one the other one :). here is some code