cakephp-1.2

How to include javascript in cakephp 1.3?

会有一股神秘感。 提交于 2019-12-04 20:55:36
Wait moment this question not duplicated..it is sample and difficult at the same time. This simple problem make me crazy.. http://www.mediafire.com/?2vi2kc7tpqiw1to This is slide code contain CSS, HTML, jQuery code. This slide works fine, but when I include this slide in cakephp it is not working. I put jQuery files and CSS in webroot and put the code to include in layout/default.ctp like this echo $javascript->link('jcookie.js'); echo $javascript->link('jquery-1.3.2.min.js'); echo $javascript->link('jcarousellite.js'); echo $javascript->link('jquery-1.js'); but still nothing happen ..please

how to create dynamic navigation menu cakephp

。_饼干妹妹 提交于 2019-12-04 16:35:21
How can I build navigation menu from categories and sub categories, like this: http://mysite/categories/view/1/2 I tried menu builder 1.01 but it only works for acl users. I also read this tutorial , but it was not helpful. Your first link doesn't work. Frankly, I'm not even sure I understand what you're trying to do. The second link you supplied - I admit I only looked at the first code snippet - doesn't use a database table. If you want your menu to be dynamic, as in based off controller actions, that makes sense. If you want it to be "dynamic" as in having dynamic control over menu items

How do you log php errors with CakePHP when debug is 0?

我是研究僧i 提交于 2019-12-04 14:49:48
I would like to log PHP errors on a CakePHP site that has debug = 0. However, even if I turn on the error log, like this: error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED log_errors = On it doesn't log errors. The problem is that even for a parse error that should cause the CakePHP environment to not load completely (I think), it still blocks the error from being logged. If I set debug to 3, it logs to the file without issue. I am using CakePHP 1.2. I know this is apparently made easier in 1.3, but I'm not ready to upgrade. Another way to keep track of and log errors would be to use the

CakePHP: Action runs twice, for no good reason

好久不见. 提交于 2019-12-04 09:41:18
问题 I have a strange problem with my cake (cake_1.2.0.7296-rc2). My start()-action runs twice, under certain circumstances, even though only one request is made. The triggers seem to be : - loading an object like: $this->Questionnaire->read(null, $questionnaire_id); - accessing $this-data If I disable the call to loadAvertisement() from the start() -action, this does not happen. If I disable the two calls inside loadAdvertisement(): $questionnaire = $this->Questionnaire->read(null, $questionnaire

How do I query data in CakePHP using HABTM relationships?

会有一股神秘感。 提交于 2019-12-04 06:14:13
I'm working on a CakePHP 1.2 application. I have a model "User" defined with a few HABTM relationships with other tables through a join table. I'm now tasked with finding User information based on the data stored in one of these HABTM tables. Unfortunately, when the query executes, my condition is rejected with an error about a missing table. Upon inspection it seems that CakePHP is not including any of the HABTM tables in the select statement. My User HABTM relationship is as follows: var $hasAndBelongsToMany = array( 'Course' => array( 'className' => 'Course', 'joinTable' => 'course_members'

Names of HTML form naming conventions

梦想与她 提交于 2019-12-04 04:16:58
In Rails and CakePHP1.2, forms tend to include input elements with names like the following: <input name="comment[author]" /> Is there a formal name for the notation used in the "name" attribute? Likewise, in CakePHP1.1 I do believe that the same would have looked like this: <input name="comment/author" /> Again, is there a formal name for the notation used in the "name" attribute? in cake php, the naming scheme is in multidimensional array access format, though i'm not really sure what you'd call that. multidimensional array keying? official php docs call it "square bracket notation"

Good DB Migrations for CakePHP?

拟墨画扇 提交于 2019-12-03 04:23:25
问题 I have been trying a few migration scripts for CakePHP but I ran into problems with all of the in some form or another. Please advice me on a migration option for Cake that you use live and know works. I'd like the following "features": Support CakePHP 1.2 (e.g. CakeDCs migrations will only be an option when 1.3 is stable and my app migrated to the new codebase) Support for (or at least not halt on) Models with a different database config. Support Models in sub-folders of app/models Support

CakePHP: Action runs twice, for no good reason

扶醉桌前 提交于 2019-12-03 03:46:35
I have a strange problem with my cake (cake_1.2.0.7296-rc2). My start()-action runs twice, under certain circumstances, even though only one request is made. The triggers seem to be : - loading an object like: $this->Questionnaire->read(null, $questionnaire_id); - accessing $this-data If I disable the call to loadAvertisement() from the start() -action, this does not happen. If I disable the two calls inside loadAdvertisement(): $questionnaire = $this->Questionnaire->read(null, $questionnaire_id); $question = $this->Questionnaire->Question->read(null, $question_id); ... then it doesn't happen

Time redirection in cakePHP ?

落爺英雄遲暮 提交于 2019-12-02 19:30:54
问题 header("refresh:5; url='pagetoredirect.php'"); we can use this if we want to redirect our page in 5 second , is there any way to redirect page in 5 second in cakephp ? if yes please let me know 回答1: You could try with AppController header() method: http://api.cakephp.org/class/app-controller#method-AppControllerheader In your controller: class CarController{ public function add(){ $this->header("") //Implemented on AppController::header } } 回答2: /cake/libs/controller/controller.php /** *

Good DB Migrations for CakePHP?

老子叫甜甜 提交于 2019-12-02 17:37:30
I have been trying a few migration scripts for CakePHP but I ran into problems with all of the in some form or another. Please advice me on a migration option for Cake that you use live and know works. I'd like the following "features": Support CakePHP 1.2 (e.g. CakeDCs migrations will only be an option when 1.3 is stable and my app migrated to the new codebase) Support for (or at least not halt on) Models with a different database config. Support Models in sub-folders of app/models Support Models in plugins Support tables that do not conform to Cake conventions (I have a few special tables