cakephp

CakePHP Component not working

Hey guys, I'm working on a cakephp app that manages a list of alpha users. It's a simple form that accepts a name and email and then generates an alpha code after submission, that alpha code is then stored in the record with the name and email under the column "code." I'm using a component calleed PasswordHelper which is located here ...

cakephp validation losing parameters

CONTROLLER class ImagesController extends AppController { var $name = 'Images'; var $uses = array('Image','Person'); var $helpers = array('Html', 'Form'); function add($idp = 0, $mac = 0) { if (!empty($this->data) && is_uploaded_file($this->data['Image']['File']['tmp_name']))...

Chained contain and paginate in Cakephp

Two Languages belongs to Lset, Lset HABTM Translator It is defined as follows: Translator: var $hasAndBelongsToMany = array( 'Lset' => array( 'className' => 'Lset', 'joinTable' => 'lsets_translators', 'foreignKey' => 'translator_id', 'associationForeignKey' => 'lset_id', ) ); L...

The record 999 can not be retrieved.

Hi all, In my sample database table, I have a record with post id 999. I got a few lines of code to retrieve the record of post id 999: function viewing($sid){ $this->Testing->post_id=$sid; $this->set('posts', $this->Testing->read()); } But no record can be record retrieved from the post with id 999 when I altered the code: func...

Cakephp: Include php script in .ctp file

I want to add captcha in myfile.ctp. For this i found source for captcha along with some resource files includs(js, php). I know the folder for js files & include this file using <?php echo $javascript->link(array('ajax_captcha.js'));?>. But I don't know where to place .php file & also how to include it in myfile.ctp Or if anybody help ...

MongoDB and CakePHP Model associations

Hi, I'm trying to make a Match model which includes the players lined up during that match. So each Match hasMany Players and each Player hasmany Matches. match = { '_id' : ObjectID('978tqwbi9873gofiu'), 'home' : 'Argentina', 'away' : 'Brazil', 'lineup-home' : [ {'name' : 'Lionel Messi', 'goals' : '2', 'timeon' : 30 }...

How to use sql 'between' command with CakePhp requestAction()

Hello, I have an element that grabs data from mysql. Here is my working code: $this->requestAction('posts/index/sort:id/direction:desc'); I want to grab only posts between id 1 and 6. How can I run that query via requestAction? Some of scripts that I have tried are below. None is working: $this->requestAction('posts/index/sort:id/di...

relative URLs in cakePHP

Hi all, I am using cakePHP 1.26 and TinyMCE v3.38. The .js file of the TinyMSC is stored under this directory: http://www.mysite/js/tiny_mce/tiny_mce.js In the page where the users can post new topic, the URL of this page is like this: http://www.mysite/user/newpost Now I need to add the javascript to this page, and I have tried these...

Conflict between JQuery and TinyMCE

Hi all, I got a .ctp web page with the following lines of code: <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ theme : "simple", mode : "textareas", convert_urls : false }); </script> <Script language="javascript"> $(document).rea...

addClass, removeClass and Remove methods can't work when work with TinyMCE

Hi all, I got a .ctp web page with the following lines of code: <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ theme : "simple", mode : "textareas", convert_urls : false }); </script> <Script language="javascript"> $(document).rea...

Failed ARO/ACO node lookup

I'm getting a weird error when running through the tutorial in the e-book, "Practical CakePHP Projects" in chapter 8, "A Cake Control Panel". Everything is built out, the DB is set-up and completely blank, and I'm running through the test at the end of the chapter to verify everything is working... I'm not sure what happened, but I keep ...

Will cakephp 1.3.2 work on php 5.3 ?

Will cakephp 1.3.2 work on php 5.3 ? ...

Custom Submit button

hi all, how can i create submit button, and define custom title on it, together with custom class style? tnx in adv! ...

jQuery - Ajax returning error 500 on some posts.

I have some Ajax that has been working on a live site, now it has stopped working. The Ajax should be returning a page but is returning a 500 error (internal server error). The strange thing is I can navigate and post to the page the Ajax is calling, so the page is only not working via an Ajax call ($.post). Another strange thing is it...

CAKEPHP : Can use plugin in plugin ?

example: I want use plugin tree in plugin forum I cant do this . Who can suggest about this ? plugin in plugin , i mean: Folder App ----|plugin -----------|plugin ...

[CakePHP] Count number of hits

hi all, i'm developing simple cms application. i want to integrate "number of hits" for some of the records, so when view of the record is showed in browser, hits field in table should be updated by 1. in controller, i tryed with: $data = array( 'Publication' => array( 'hits' => ' hits + 1') ); $this->Publication->save( $data );...

validation on a input file in cakephp

In cakephp I am trying to check if an file input field has a file attached, and if not output an error. I have done this with other fields but just can't seem to get this to work on that field. Here is the model array('notempty'), 'uploadeduploaded_file' => array('notempty') ); ?> and here is my ctp file <?php echo $form...

[CakePHP] Custom static layout

hi all, i want to add static html page layout for my application (advanced search layout). i would like that it will be accessed by url http://myapp/search tryed to create custom controller (search_controller.php) and index view (view/search/index.ctp), but cake requires database table search. also, followed info from http://cake-p...

Ajax Response from CakePHP Controller returning null

I'm tryin to validate an input field with an ajax call to a cakephp controller My Ajax is: $("#UserAlphaCode").change(function () { $.ajax({ type: "post", url: '<?php echo $this->webroot ?>' + "/alpha_users/checkCode", data: ({code : $(this).val()}), dataType: "json", s...

CakePHP: Editing Cipher Behavior to use built in cipher instead of blowfish

Does anyone know how to change http://bakery.cakephp.org/articles/view/cipher-behavior to use cakephp's default ciper instead of Blowfish to encrypt/decrypt fields? After reading through the behavior, I thought that maybe I could just switch out $bf = new Crypt_Blowfish($key); with $bf = new cipher($key); or something to that ...