cakephp-1.3

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 /** *

Cakephp 2.1 naming convensions issue in version change

强颜欢笑 提交于 2019-12-02 13:25:22
I have just installed CakePHP 2.1. And just see that the naming convention of its is just change lot from the older version which making me crazy. Like it was app/controllers while now it is app/Controller same way app/models - app/Model app/views - app/View I know there must be some advantage on doing this. But my problem is when I use the cake bake it is creating directory in the same old fashion i.e. controllers/models/views . Which is no more accessible from the URL & obviously will throw an error. Is anyone there who has face the same issue ? Is there any solution that cake bake also use

Time redirection in cakePHP ?

两盒软妹~` 提交于 2019-12-02 12:53:55
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 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 } } /cake/libs/controller/controller.php /** * Convenience and object wrapper method for header(). Useful when doing tests and * asserting that particular headers

cake php, how to populate a drop down selection based on another drop down selection?

╄→гoц情女王★ 提交于 2019-12-02 12:02:09
I have a table something like this: id test attr dim 1 test1 a1 d1 2 test2 a2 d2 3 test3 a1 d3 4 test3 a1 d2 I am creating a drop down field that shows the attr as having only two options a1 and a2 . Based on a selection of either a1 or a2 i would like to do is something like: if (a1 is selected){$a == a1} else {$a == a2} $test = mysql_query("SELECT dim FROM xxx WHERE attr = $a") and fill up the second drop down with the results from that query that could be d1 , d2 or d3 and so on, on multiple drop down lists if I need to. I know how to do this in regular php but not sure how to do it in

A specific column is not being inserted when saving a record

只愿长相守 提交于 2019-12-02 10:49:59
问题 I am working with CakePHP 1.3.13 . Here I have writen a code to insert form in to database. Here, deals database table looks like below. When I insert record into database so voucher_code column is not inserted. Here when I print $this->data then it will gives all data like : Array ( [Deal] => Array ( [title] => Deal title [original_price] => 350 [discount] => 45 [total_price] => 192.5 [voucher_code] => TEST3211 [redeem_points] => 158 [deal_details] => tetert [condition] => Testing [deal

A specific column is not being inserted when saving a record

孤者浪人 提交于 2019-12-02 04:31:43
I am working with CakePHP 1.3.13 . Here I have writen a code to insert form in to database. Here, deals database table looks like below. When I insert record into database so voucher_code column is not inserted. Here when I print $this->data then it will gives all data like : Array ( [Deal] => Array ( [title] => Deal title [original_price] => 350 [discount] => 45 [total_price] => 192.5 [voucher_code] => TEST3211 [redeem_points] => 158 [deal_details] => tetert [condition] => Testing [deal_address] => tertre [deal_end_date] => 2016-05-26 [no_of_deals] => 10 [merchant_id] => 24 [image] =>

CakePHP HTML Helper: image within a link gets escaped?

谁说胖子不能爱 提交于 2019-12-02 02:10:59
问题 Updating from Cake 1.2 to 1.3 and I have an image nested in a link element, both generated by the HTML helper. The nested image's markup is however escaped from < to > ect. I know the HTML helper now escapes stuff by default, but I can't get it to change this behavior. This is the code generating an example image link: $html->link($html->image('icons/small/navigation-back.gif', array('alt'=>"Move Left", 'border'=>"0")) ,'#',array('id'=>'options_left'), array('escape'=>false)) I added the

cakephp: remove stars in all choices in a radio button

谁都会走 提交于 2019-12-02 01:30:56
I have a radio button in my form using the following code echo $form->input('Users.vote', array( 'type' => 'radio', 'label' => array('text' => __("form_vote", "true"), 'class' => 'vote'), 'options' => array('1' => 'a', '2' => 'b', '3' => 'c' ), )); This is my model validation for vote 'vote' => array( 'rule' => 'inList', array(1,2,3), 'allowEmpty' => false, 'required' => true, 'message' => 'error_vote' ) Problem is that it adds a * right next to the a, b and c choices. Here is a screengrab on what it looks like with the stars on all three choices. http://imageshack.us/photo/my-images/23

Take user back to previous page after logging in?

天涯浪子 提交于 2019-12-01 22:08:49
I have a controller called Accounts, with the views signin and signout. The corresponding functions look like this: function signin() { if (!empty($this->data)) { //handle login ... //save login to session $this->Session->write('Account', $data["Account"]); //redirect to previous page ??? } } function signout() { //delete login $this->Session->delete('Account'); //redirect to previous page ??? } If the user goes to accounts/signin it first checks to see if the form is submited if(!empty($this->data)) if yes, it logs them in, if not it renders the signin form. If they do succesfully log in, I

CakePHP 1.3 - Unknown column in where clause

不羁的心 提交于 2019-12-01 17:03:30
I'm working on an already existing cakephp 1.3 project and I needed to add a new table to the database. I have this in my controller: $conditions = array('ShootingPlacement.person_id' => $id, 'Email.person_id' => $id, 'Email.shooting_placement_id' => 'ShootingPlacement.id'); $shootingPlacements = $this->ShootingPlacement->find('all', compact('conditions')); And it's giving me this error: Warning (512): SQL Error: 1054: Unknown column 'Email.person_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 684] And ths is the query it's trying to create: SELECT