cakephp

Behaviors on CakePHP 1.1

I have used cakePHP 1.2 and know how to use behaviors in it. using cakephp 1.1 on a new project(i know it might sound silly but the project is very similar to an older project we have which was built on 1.1). after a little googling i have come to believe that cakephp 1.1 models did not have behaviors. cannot find any reference in the ...

Problem providing intro text in blog application (using cake php)

Background I am developing my blog application in Cake PHP. I aim to provide an intro text for each post on the home page. The user can then click on the "Read more" link to read the entire post. Following is my posts table. $query = 'CREATE TABLE posts ( id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255)...

Counting number of articles within a category using CakePHP?

Hi I have a simple cakephp app with table "articles" that has a "cat_id" column to reference a "id" column of categories in a "cats" table. What I would like to do is display all categories names, each followed with a count of the number of articles belonging to that category. I know there is a find('count') function in cakephp, but t...

Want to Pop-Up a window with an action in CakePHP [Closed]

Well I am trying to convert an image into an button on a page of application done in CakePHP.This is the first issue.I can not use the image as a button.After that I want a Javascript which pops up a window of the action in it...!!!How can I do this thing...can any1 tell me how to do that..!!! ...

counterCache in cake php

I want to display the total number of comments for a particular post in my blog. I have 'posts' and 'comments' tables in my database. Now, I am a bit confused about using counterCache. I first created a field in the 'posts database', namely, 'comment_count' and then I added the counterCache key in the post model. var $hasMany = array('...

BelongsTo problem in cakephp and html select, i can't understand how to do that

Simple question by a cakephp noob: i have two models, Player and Team. Team has an id (int) and a cool_name (varchar). Player has an id (int), a cool_name (varchar) and a reference for the team table, team_id (int). Cool_name instead of name because i don't have tables in english, so i can't use the field 'name'. So, a team hasMany ...

Problem in retrieving a value through $_GET method in php.

I have a link and on clicking it, a function is called. In that function, I set the href attribute to pass an id variable. If I alert the href value, I see the correct url along with the Id. But in the corresponding function in the controller, If I do an $_GET of that variable Id, I do not get the value. What is the error? This is my li...

Inflector::humanize($key) converts Date of joining TO Date Of Joining

Hi, I have a Form and i am submitting them like using function submit($formid = null,$fillerid=null) { $this->data['Result']['form_id']=$formid; $this->data['Result']['submitter_id']=$fillerid; $this->data['Result']['submitter']=$this->Session->read('filler'); echo "submitter: ".$this->Session->read('filler'); ...

cakephp simpletest webtester delay/sleep function

hi, I am using simpletest to do integration testing of my websites, and I need to tell the internal browser to wait for a certain amount of time (as the page is being redirected), and then do assertText. Is there an easy way to do this ? Regards ...

How Can I add Cron Tabs in a Cakephp Aplication

I am trying to Add a CronTabs in a site{bidding site}, where the aspect to add a Crontabs is for the Autobidders.Please Someone guide me how can I add a Crontabs and how can I make it working,so that if any user adds up a auto bidder,it can place bid according to the server's time...!!! Thans in Advance..!!! ...

Does CakePHP play nice with Oracle? How about other frameworks?

I'm just investigating some frameworks (CakePHP particularly) for a PHP project I'm about to start, and it must run on Oracle. A quick googling found that Cake doesn't come packaged with Oracle support, and that there is a driver someone wrote, but that was back in April 2007, so I don't know how valid the information still is. Has any...

Usage Quotes in JQuery

Hi, I am using JQuery and cakephp for my application. I have created a select input Element using $(document).ready(function(){ $("#"+<?=$r['Attribute']['id'];?>).each(function() { type= "<?=$r['Attribute']['type'];?>"; attribute_id= "<?=$r['Attribute']['id'];?>"; if(type=="dro...

Unterminated String Literal in JQuery

Hi, I have used cakePhp Form->input to create a Dropdown box inside JQuery using $('<?php echo $form->input($r['Attribute']['label'], array('name'=>$r['Attribute']['label'],'options'=>array(1,2,3)));?>').appendTo("#main #EntrySubmit"); But its showing me the error as Unterminated String literal...Why so??? ...

CakePHP and .htaccess in shared hosting environment

Greetings! I have CakePHP based app on shared hosting I wonder if there's a way to clean up the url through .htaccess. What bugs me is that I have to have index.php in it or I get a 404: project.com/index.php/controller/method Initially I was getting a 404 error no matter what and my host admin ended up setting RewriteEngine off and t...

cakephp data validation before posting remote form

This one is really racking my brain: I need to post non-sensitive data to a third party payment gateway. I want to use the built in cakephp form validation which is working fine. What i am doing is submitting the form to a local action which calidates the data and outputs any errors if there are any. Where i am stuck is trying to re-sub...

Why there is a field named "language" in the CakePHP's config file

Well, I was going through an application where a find a variable named as "language" in the config file of the Cake application.Then I also found the same thing in the Bootstrap,where it called the same thing from config file.Could anyone explain me what does this thing do from the config file.Is there any rule Globalization behind this....

CakePHP: Numbered Paginated Results

The title is a bit wonky but it's the best I could come up with at 4 in the morn'. I have a table of links that I am paginating, nothing fancy. Let's say there are 100 links that are displayed 20 a page for 5 pages. How can I number each link starting with 1 and ending with 20 on the first page and if we skipped to the last page would...

MVC beginner question - editing many-to-many relations

I'm using CakePHP to build an application using the MVC Pattern, but my question is language agnostic, I guess. Here's an overview of a part of my data: ITEMS (id, name, description) LOCATIONS (id, name) The items table describes a type of item ("apple", "orange", "banana"), not individual items. Each location can have any number of...

saveall with hasOne saves blank foreign key

I have th e following model relationships: Enquiry: var $hasOne = array( 'SeminarAttendence' => array( 'className' => 'SeminarAttendence' ) ); SeminarAttendence: var $belongsTo = array( 'Enquiry' => array( 'className' => 'Enquiry', 'foreign_key' => 'enquiry_id', ) ); my post data looks like this: [Enq...

php frameworks and security

As a web developer I am using PHP and I know that I have to worry about security but when you use a framework, there is a lot-of code and design that you relay on but that you didn't code or design and for instance I am using CakePHP. so in this case with frameworks how much should i worry about security ? ...