cakephp-2.1

cake console 2.2.1: Bake errors

北城余情 提交于 2019-12-23 21:54:36
问题 OSX machine running MAMP. CakePHP 2.2.1 installed and configured properly (meaning that I have all green bars when I browse to the Index.php file, I have completed the Blogs tutorial and am working on my second app with which scaffolding is up and running). Now I am trying to Bake for the first time. Per the cookbook (and others), I installed a fresh copy of cake into a directory (my users directory) and then put the path variable in my .bash_profile file export PATH="$PATH:/Users/p_scott

cakephp basic help to use cakedc search plugin

倾然丶 夕夏残阳落幕 提交于 2019-12-23 05:24:04
问题 I'm using cakephp 2.1 and cakedc search plugin. The thing is I can't glue it together. Also got: Notice (8): Indirect modification of overloaded property ProjectsController::$paginate has no effect [APP\Controller\ProjectsController.php, line 48] Followed cakedc tutorial but something's missing! Simple search just won't filter anything. I want to filter by name field. On my projects model public $actsAs = array('Search.Searchable'); var $name = 'Project'; public $filterArgs = array( array(

CakePHP 2.x - jQuery EasyUI - how to put jQuery EasyUI in CakePHP 2.x?

人盡茶涼 提交于 2019-12-23 03:37:11
问题 I have a problem. I don't know where to put jQuery EasyUI in CakePHP? Which folder? Do I use it like a helper? Do I have to put something like: var $helpers = array('jQuery'); Do I have to put some in view? Thank you so much for your help always. :) Edit: And if you can give me some online tutorials with jQuery EasyUI with CakePHP 2.x. (I already Google it.) :D 回答1: In CakePHP javascript files are stored in app/webroot/js/. You then can include them in the layout by calling echo $html->script

How can I get full link to an image in the img tag through the Html helper (image method)?

两盒软妹~` 提交于 2019-12-22 18:01:56
问题 I have this code snippet in an email layout: <div> <?php echo $this->Html->image('Layouts/default/Logo.png', array( 'alt' => 'Setin SRL', 'url' => $this->Html->url(array('action' => 'index'), true) )); ?> </div> However this is not ok. I can get the FULL url to the website through url(array('action' => 'index'), true) But I can't find any paramater that I can set to true for image too. Any suggestion or workaround on how can I do this? Edit 1: Basically, I need this link: Layouts/default/Logo

sending data via ajax in Cakephp

…衆ロ難τιáo~ 提交于 2019-12-22 15:35:16
问题 i am new to cakephp and trying to send data from ajax to my controller action.. i have a popup model in which there is a input box ..i want to grab that value and send to controller without page refresh here is my code .. <a class="button anthracite-gradient" onclick="openPrompt()">submit </a> my javascript function openPrompt() { var cancelled = true; $.modal.prompt('Please enter a value:', function(value) { $.ajax({ type:"POST", url:"/cakephp/controller/action/", success : function(data) {

Bake tool cannot see tables in SQLite3 database

随声附和 提交于 2019-12-21 16:59:44
问题 I am trying to build a simple app with CakePHP 2.1.1 using SQLite3 as the database. To save time I tried to use the bake tool to create a model for the following table: CREATE TABLE animals ( id integer primary key autoincrement, name text ); but the bake tool returns the following error: Your database does not have any tables. I figured Cake had a problem connecting to the database, so I went ahead and created the appropriate model, controller, and views myself. I inserted a single record

CakePHP: Creating new HABTM row instead updates other

谁说我不能喝 提交于 2019-12-21 05:42:23
问题 I have two models with a HABTM (Has and belongs to many) relationship: Qsets and Questions. The following action (in QsetsController.php) should result in a new row in the qsets_questions table, with the new question appearing in the new qset. But instead it updates existing rows, resulting in that question begin taken from a previous qset and added to the new one. What am I doing wrong? public function admin_add_question( $qset_id, $question_id) { //find the qset... $qset = $this->Qset->find

Triggering event manually in JS Helper CakePHP

♀尐吖头ヾ 提交于 2019-12-21 04:48:40
问题 I stuck in a situation. I am using JS Helper. I used the following code. <?php $this->Js->get('#client_id') ->event('change', $this->Js->request(array('action' => '../ajax/get_client_location_and_process'), array('update' => '#client_location_process', 'async' => false, 'dataExpression' => true, 'method' => 'post', 'evalScripts' => true, 'data' => $this->Js->serializeForm(array('isForm' => True, 'inline' => True)) ) ) ); I want to trigger the change event on page load. If I am using document

CakePHP keeps logging me out

百般思念 提交于 2019-12-21 04:41:02
问题 Recently i have made three Cake Apps and all three share this problem. The config is mostly stock and i use this as the session options. Configure::write('Session', array( 'defaults' => 'php', 'cookie' => 'test' )); After lots of googling everyone just suggests that the security level is too high, but i have never changed this value, it's: Configure::write('Security.level', 'medium'); Edit : I have also tried with low security and no change. I am only using basic auth to check if the user is

CakePHP: How to update multiple records at the same time with the Form helper

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 02:44:12
问题 On an edit page for the model Test I want to be able to update the "Questions.order" field on all of it's associated (by hasMany) questions from the same form. I've ready the Cake book chapter on saveMany()/saveAll() in the book, and I'm using the Model.0.field syntax but I can't figure out how to tell CakePHP which record to corresponds to which input. Should the # in Model.#.field correspond to the question's id field? Here's what I'm currently doing: echo $this->Form->create( 'Question',