cakephp-1.3

Using the CakeDC search plugin with associated models

ぐ巨炮叔叔 提交于 2019-12-13 04:19:50
问题 I'm using CakePHP 1.3.8, and I've installed the CakeDC Search plugin. I have a Tutorial model, which is in a HABTM relationship with a LearningGoal model. I have a search action & view in the Tutorials controller with which I can successfully search fields in the Tutorial model. I'd also like to filter my tutorial search results using LearningGoal checkboxes on the same form. I've tried adding various parameters to Tutorial's $filterArgs and TutorialsController's $presetVars. I've also tried

CakePHP: Internationalizing Web Application

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:04:16
问题 Based on the below article, I was able to internationalize my CakePHP application to certain extent - http://puskin.in/blog/2010/08/cakephp-manage-multiple-language-in-application/ I want to extend this functionality and provide the ability where user can save the preferred language in his User profile. And everytime the user logs in, I want to use the preferred language and display the content of the site in that language. Ex - Facebook language setting. As soon as you change the language,

CakePHP theme resources return error

大兔子大兔子 提交于 2019-12-13 03:39:09
问题 I've never had problems with CakePHP's theming system in the past, but now, errors galore. My main issue is that all theme resources (those in /app/views/themed/MyTheme/webroot/*) fail to load. I've set up a custom AppController in /app to set the theme. var $view = "Theme"; var $theme = "MyTheme"; When I go to any page, I can see that it's utilizing my theme's default.ctp layout and the HTML is fine. Any and all page resources, CSS, JavaScript, images, anything in the theme webroot, fails to

how to prevent an element to validate

送分小仙女□ 提交于 2019-12-13 02:59:12
问题 hi to all i am using cakephp framework for my project. in on of my form i take a checkbox on click on this two other text box are shown. by using cakephp validates method i validate the form data but i want that when the checkbox is not checked then it avoid the validation for that text box. it check only when the checkbox is checked. so plz help me. thanks in advance 回答1: You can use your models beforeValidate servicecall for that and add extra validation criteria for this model. For example

CakePHP Session Expires - Frequently

ぃ、小莉子 提交于 2019-12-13 02:51:50
问题 I am using CakePHP 1.3 and in core.php. I set the following settings Configure::write('Security.level', 'low'); Configure::write('Session.timeout', '12'); But after logged in, its frequently logged out. I am not using auth component 回答1: Session.timeout - Base session timeout in seconds. use Configure::write('Session.timeout', 12 * 60 ); 来源: https://stackoverflow.com/questions/6899383/cakephp-session-expires-frequently

unable to write xml sitemap in cakephp

你。 提交于 2019-12-13 02:41:53
问题 UPDATE To make it a little more clear to some about what's going on, my page does NOT display the document tree(the first time I've ever seen this). Just one long line of my xml content WITHOUT any xml elements/tags. I followed this tutorial for creating a dynamic sitemap in cakephp. This tutorial was written in 2008 and I (have inherited) am working in a cakephp 1.3 app (I am assuming this tutorial would be valid for 1.3? I've looked at some others that pretty much used the same code from

CakePHP: Internationalizing a web application - Design and Examples?

蹲街弑〆低调 提交于 2019-12-13 02:38:21
问题 I have a web application built using CakePHP framework and now I am in the process of internationalizing it. I started with the base set-up as outlined in the below article - http://puskin.in/blog/2010/08/cakephp-manage-multiple-language-in-application/ and also add little bit of customization based on my previous question - CakePHP: Internationalizing Web Application To completely internationalize my web app, I would need to translate my drop-down/look-up content as well, like - categories,

How to disable cache on logout in CakePHP

三世轮回 提交于 2019-12-13 01:16:24
问题 I am using cakephp 2.3 version. I need to disable cache only when the user logs out. This is to prevent login in case the back button is pressed. But for all other scenarios I don't want to disturb caching mechanism. Right now i use the following function in AppController: public function beforeRender() { $this->response->disableCache(); } But I doubt that it disables the caching process completely. Please help! 回答1: I don't believe the user is automatically logged back into your site if they

'Set' in Components of Cake PHP

…衆ロ難τιáo~ 提交于 2019-12-12 18:35:01
问题 How to use Set function inside components in cake php ? class TestComponent extends Object { //etc $this->set('User', $user); } I am getting an error Fatal error: Call to undefined method TestComponent::set() How this can be corrected ? 回答1: function startup($controller) { $this->controller = $controller } function something() { $this->controller->set('User',$user); } Cake passes the Controller reference to the startup function of a Component. You need to keep a reference in your component to

cakephp force index at model

佐手、 提交于 2019-12-12 18:33:40
问题 I use find method which use "FORCE INDEX" in Model. Model is fine, but when I make a test for that find method, the SQL error happened. I use test/fixture and define DB schema and data. In the test/fixture, I don't know how to define index. Therefore, DB for test didn't have index. It would be great if you could show me how to define index in test/fixture. In Model... $this->Model->find('all', array( 'fields' => array('foo'), 'conditions' => array('foo' => foo), 'joins' => array('FORCE INDEX