cakephp

CakePHP 1.3 - controller dump

I started out in cake 1.2.6 a short time ago and liked the controller dump feature because it showed me what was going on, and at which points in my app the objects were instantiated, and their contents. In 1.3 how can I find out the names of instantiated objects, and how do I get a dump of them? ...

CakePHP - $hasAndBelongsToMany and $hasMany relationships between tables that reside on separate databases and have different querying languages?

I have quite the complex problem to tell you about Stackoverflow, you see I have three tables that I need to define associations between for an application. These tables are: engineers, tickets, and testcases. I need to have a $hasMany relationship between engineers and tickets, and a hasAndBelongsToMany relationship between testcases an...

Cakephp images from css using themes

im using themes in an app im doing, and need a global css/img/js folder i have tried using app/webroot as this folder, but cant get any css from a theme to show the images. I have a setup like :: /app/views/themed/my_theme/webroot/css/file.css With some css that looks like: ... body{ background-image: url('../img/file.jpg'); } ...

$.get not working ?

Hi, I used this method to load page ... function remoteCall(sUrl, sQueryStr, sCalledBy) { var str = " { "; $.post(sUrl,sQueryStr, function(data){ sResponse[sCalledBy] = data; //alert(data); eval(" "+sCalledBy+"()"); }); } but when i changed $.post to $.get it doesn't work actually i need ...

How to pass form field params to CakePHP Ajax Helper functions

I've done some jQuery functions in a CakePHP project but finally I decided to try the Ajax Helper . Unfortunately I don't get the idea of how to pass a parameter (form field value) to the AJAX function. I did the following: $obtainProduct = $ajax->remoteFunction( array( 'url' => array( 'controller' => 'products', 'acti...

What is wrong with this condition?

i getting errors if one of my conditions is: $conditions[] = array("PublicationNumeration.publication_numerations_published_date" => '2006-01-01' ); what is wrong with this condition? but everything works ok with $conditions[] = array("PublicationNumeration.publication_numerations_published_date" => '2006' ); ... but that's not a...

CakePHP What is the best way to retrieve database information in a helper?

What is the correct way to retrieve Database information using a custom cakePHP helper? ...

CakePHP - how do I access the session from a plugin?

I thought I would be able to get a session variable from within a plugin component with $this->Session->var but it looks like $this->Session is not available. How do I access the session from the main app? ...

How to show paginated results for the category items of the selected category in CakePHP?

Hello there, Currently i'm having a problem with the pagination of some results. The problem is the following: I have a website with 3 tables: categories, categories_companies and companies. In a many-to-many relationship. When i select one category, it shows the companies that belongs to the selected category. My problem is here! I do...

Submit form button not working for simple todo list app (I'm new to CakePHP)?

Hello, I am learning cakephp, and I was just doing a simple Todo list app from a book. The app basically takes in a task from an input field, then you click 'Add Task' and the task should be added to database and then the user gets redirected to Tasks View page where all the tasks can be seen including the one they just added. In the ad...

CakePHP, How do I accept a parameter for a controller and not use an action?

Would like http://websites.com/users/username1 URL structure ...

Submit a URL as data in cakePHP

Hi all, I am using cakePHP 1.26. I got an Input Text box which contains a URL and I want to submit the URL and stored it in the Database using Jquery AJAX. Here is the HTML part: <input type="text" id="testing" value="http://stackoverflow.com/questions/ask"&gt; This is the JQuery part: var whatContent=$("#testing").val(); ...

What you would do to a URL that contains some special characters.

Hi all, I am using cakePHP 1.26 I got an Input Text box which contains a URL and I want to submit the URL and stored it in the Database using Jquery AJAX. Here is the HTML part: <input type="text" id="testing" value="http://stackoverflow.com/questions/ask"&gt; This is the JQuery part: var whatContent=$("#testing").val(); va...

Couldn't recieve any data using JQuery AJAX in cakePHP

Hi all, I am using cakePHP 1.26. I was trying to use JQuery AJAX to pass some sample data to a function in a Controller, but failed to do it. This is the JQuery Part: var w="helloworld"; var curl="http://localhost:8080/test/grab/"; $.ajax({ type: "POST", url: curl, data: "testing="+w, success: function(data) { al...

What value will be returned when a Table got updated?

Hi all, I am using cakePHP 1.26. I was trying to update a Table using these lines of code: $c = "helloworld"; $q="UPDATE user SET avatar='{$c}' WHERE user_id='999999'"; $result=$this->Test->User->query($q); if($result==true){echo "success";} else{echo "failed";} I noticed that the Table was updated successfully, but I still saw the ...

Why Regular Expression in CakePHP ( must CakePHP )

Why does this code run differently in CakePHP vs. a normal PHP file? <?php $data = " One Two Three Four"; $data = trim($data); $data = preg_replace("/\n{2,}/", "\n", $data); $data = explode("\n",$data); var_dump($data); ?> When I run this code in a normal PHP file, I get array 0 => string 'One' (length=3) 1 => string 'Two...

How to connect two different DB tables using Cakephp?

convert following query into cakephpquery. "SELECT * FROM user1.user_favourites,esl.esl_lyrics WHERE esl_lyrics.id=user_favourites.fav_recordID AND user_favourites.fav_userID=".$user_id." AND user_favourites.fav_widgetID=$wid_id"; Models files are esl.php and userFavourite.php DB are user1 and esl. DB tables are user_favo...

controller and action Returning to cakephp-hDemo page ???

Hi, i am getting this url in my firebug Console tab GET http://www.boxyourtvtrial.com/widget/calorie/calories_trial/js/cbc_handler.js?_=1280734587082 GET http://www.boxyourtvtrial.com/cakephp-hDemo/cbc/index GET http://www.boxyourtvtrial.com/cakephp-hDemo/cbc/calburned But what i want is http://www.boxyourtvtrial.com/cakephp-hDemo is...

need some advice on my database design

Hi all, I am using cakePHP 1.26. I am going to build a very simple forum on localhost. Here is the conceptual design for the Database: Tables: User {user_id, name, date} Topic {post_id, title, content, date} Reply {post_id, content, date} Quote {quote_post_id, post_type, post_id} A User may have many Topic A User may have many Reply A...

PHP Framework Overhead

There are tons of PHP frameworks out there; some are pretty decent, others seem bloated and unnecessary. After watching Rasmus Lerdorf's presentation on PHP performance at Digg, I'm somewhat more concerned about the performance of the frameworks that I choose for building my applications with. Two of the most popular frameworks that I'm...