cakephp-2.0

Strict standards: Redefining already defined constructor for class Object in path\cake\libs\object.php on line 54

a 夏天 提交于 2019-12-18 16:12:33
问题 I am trying to configure MS-MSQL database on cakephp (Not mysql). My Wampserver is 2.2e-php5.4.3-httpd2.2.22-mysql5.5.24-32b on my laptop (which is windows x64-bit. I already invited these two dlls to run sql server extension=php_sqlsrv_54_ts.dll extension=php_pdo_sqlsrv_54_ts.dll I've got these two errors in running cakephp 1.3 Strict standards: Redefining already defined constructor for class Object in C:\wamp\www\project\cake\libs\object.php on line 54<br/> Strict standards: Non-static

how to add active class in current page in CakePhp

北战南征 提交于 2019-12-18 13:31:22
问题 i have a problem similar to this question How to identify active menu link in CakePHP i have a page in my default.ctp file in which i want to add 'active' class on links. how can i identify the current url of the page and then apply the class on link.. i have followed the answer also there which is $url = $this->Html->url('INPUT_THE_URL') ; $active = $this->request->here == $url? true: false; i dont know how can i do this in my code .. sorry for asking as i am newbie in cakephp .. here is my

Cakephp auth component with two models session

丶灬走出姿态 提交于 2019-12-18 13:01:36
问题 I have two cakephp2 applications running on same database, but having different Auth tables and different $this->Auth->userModel values accordingly. Authentication works well and users from one app can't log into other. BUT.. as apps uses same CAKEPHP session cookie, this happens: when user from app 'one' logs in, it can access any Auth protected action in app 'two'! I will probably use different user roles and cookie names. But still, why Auth component is ignoring Auth->userModel settings

Cakephp auth component with two models session

柔情痞子 提交于 2019-12-18 13:01:12
问题 I have two cakephp2 applications running on same database, but having different Auth tables and different $this->Auth->userModel values accordingly. Authentication works well and users from one app can't log into other. BUT.. as apps uses same CAKEPHP session cookie, this happens: when user from app 'one' logs in, it can access any Auth protected action in app 'two'! I will probably use different user roles and cookie names. But still, why Auth component is ignoring Auth->userModel settings

CakePHP plugin throws “Missing View” error but view file exits

…衆ロ難τιáo~ 提交于 2019-12-18 09:48:20
问题 I'm writing a basic plugin for my cakePHP 2.x app following the instructions in the book. I've created the directory/file structure with a MyPluginAppController.php and MyPluginAppModel.php. I added CakePlugin::load('MyPlugin'); to the parent app's bootstrap.php file. Then I created one Controller and Model. But for some reason when I try to view mysite.dev/(admin)/my_plugin/my_model/ I get a "Missing View" error. It says to confirm that the view file exists, which it does! I don't think I

how to use common function in helper and component In Cakephp

落爺英雄遲暮 提交于 2019-12-18 05:54:39
问题 We are familiar with Components and Helpers in CakePHP. I have an ABC Component and XYZ helper and both have same function (around 2000 lines total 4000 lines). there is any way to use same function in Controller and .CTP files. it's not good to use same function 2 time. any method so i can use Component/Helper function in Helper/Component without rewrite ? same method into component and helper >> Component class DATAComponent extends Component { public $components = array('Session', 'THmail'

CakePHP 2.3.8: Calling Another Controller function in CronController.php

百般思念 提交于 2019-12-18 04:15:22
问题 For CakePHP 2.3.8 How can I call Another Controller function in CronController.php Any ideas? 回答1: Below is the code: App::import('Controller', 'Products'); // mention at top // Instantiation // mention within cron function $Products = new ProductsController; // Call a method from $Products->ControllerFunction(); Hope it helps some one ! 回答2: Use the $this->requestAction(); method in your controller action. It's not the most recommended pattern, but it can be useful and can return data or

Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual

被刻印的时光 ゝ 提交于 2019-12-17 20:42:43
问题 Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@g.com, 'User'.'phone' = 87665r5, 'User'.'address' = 23lsdhf, 'User'.'location' ' at line 1 SQL Query: UPDATE 'cake'.'users' AS 'User' SET 'User'.'username' = paul, 'User'.'password' = eben, 'User'.'email' = paul@g.com, 'User'.'phone' = 87665r5, 'User'.'address' = 23lsdhf, 'User'.'location' =

Error handling in CakePHP 2.0. Escaped viewVars [closed]

最后都变了- 提交于 2019-12-14 04:17:43
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have encountered a strange problem with errors in Cake 2 which I have never had in 1.3. When some exception raised (i.e. NotFoundException ) Cake's error handling begins.. By default it instantiates

Can't cancel the subscription on stripe in cakephp

删除回忆录丶 提交于 2019-12-14 03:25:31
问题 I'm using this Cakephp StripeComponent plugin : https://github.com/chronon/CakePHP-StripeComponent-Plugin Everything is working fine but I can't cancel the subscription with this plugin. I had tried this https://stripe.com/docs/api#cancel_subscription, but no success. As its saying to retrieve the subscription and then cancel() But this plugin doesn't have any retrieve subscription function. When I tried this, $sub = \Stripe\Subscription::retrieve('SUBSCRIPTION_ID'); $sub->cancel(); I'm