cakephp-1.2

CakePHP 1.2.6 - TreeBehavior Issue with Bad Nodes

I've got a Pages model that I'm using the TreeBehavior for a hierarchy. I'm building a breadcrumb trail based on the Page model hierarchy. I'm having issues, though, with the breadcrumbs coming through incorrectly and reporting the wrong parents. It seems that every time I call verify(), I get this sort of result: [0] => Array ( ...

CakePHP 1.26: Bug in 'Security' component?

For those of you who may have read this earlier, I've done a little research and completely revamped my question. I've been having a problem where my form requests get blackholed by the Security component, although everything works fine when the Security component is disabled. I've traced it down to a single line in a form: <?php echo $...

CakePHP Auth component redirect issue

I am having trouble getting the Auth component do the redirects I want in a CakePHP 1.2.6 app. I have a login form that appears on all pages and I want to keep the user on the page he logs in on. For example, if he is viewing another user's profile, I want to keep him there after logging in, not redirect him to the $this->Auth->loginRe...

CakePHP 1.3.0 RC4 Installation

I have been using 1.2.6 and downloaded 1.3 to try it out. I am using wampserver with Apache 2.2.11. I have mod rewrite enabled. When I bake a new application using the cake 1.3 console, after I verify that the webroot/index.php of the application CAKE_CORE_INCLUDE_PATH is set to the Cake1.3 Installation folder. The result is a page thats...

Database table posts for model post was not found.

Hi all, I am using cakephp 1.26 to create a simple message board in my localhost. When I tried to link two tables together, I got this error: Error: Database table posts for model post was not found. Here are the table structures of the two tables: Table 'post' has these fields { PostID, Topic, Content} and table 'reply' has these ...

different methods in passing parameters in Cakephp

Hi all, I am using cakephp v1.26. I got a function in a controller like this: class testingsController extends AppController{ function testing($id=null){ $recieved = $id;} } I am not sure if there are any better ways to pass a parameter to the Action testing. But I have come across some web sites and got these two methods. Is there...

A simple message board with WYSIWYP

Hi all, I am making a simple message board with some WYSIWYP function using cakePhp 1.26. I have googled for some hints and finally reached this URL: http://bakery.cakephp.org/tags/view/wysiwyg But I am not sure which one is the best out there. ...

Where is the appropriate place to define inflector rules in CakePHP 1.3?

In CakePHP 1.2, custom inflector rules could be defined in a file app/config/inflections.php. This file was removed in CakePHP 1.3. Instead, the documentation prescribes using the Inflector::rules function to load custom inflections. There's adequate documentation of how to define the custom inflections themselves, but the documentation...

How to combine Translate and Soft Deletable Behavior in CakePHP 1.2.7?

Hi guys, i'm trying to combine Translate Behavior and Mariano Iglesias' Soft Deletable Behavior Revision 49. But always if a want to soft delete a record which hasMany other records, which are translated (located in the i18n-table partly), the related hasMany records aren't soft deleted. Example: Post hasMany Comments (dependent = tr...

Using Helper $time->niceShort with german settings in CakePHP 1.2

I want to use the CakePHP Helper "time" and his method niceShort to transform a date into a nice, easy to read one. Instead of the english default transformation I want to use a localized version (in my case: "german") but I don't know where to set this. How can I localize this method? echo $time->niceShort($comment['created']); ...

Cakephp session is not setting in pages controller

Hi, I am using cakephp1.2 . I have pages_controller which extends app_controller. I have given Session component in app controller . While login from my application, Im setting the session and redirecting to pages controller, but there I could not able to get the session. If I redirect to some other controller, Im getting the session ov...

Array values changing unexpectedly

I am using cakephp 1.2 and I have an array that appears to have a value change even though that variable is not being manipulated. Below is the code to that is causing me trouble. PLEASE NOTE - UPDATE Changing the variable name makes no difference to the outcome. function findCountByString($string, $myArr=array()) { $main_conditions['...

Empty data was able to be stored to the Database in CakePHP even if "Not Null" had been specified.

Hi all, I was doing some self learning on CakePHP 1.26 with Mysql 5. I got a simple table with only one field and had applied "Not Null" to this field. This field in the table was corresponding to a Input text box in a HTML form. I tried not to enter anything into the Input text field, and then I saw that empty data was able to be store...

PHP Eclipse - importing existing CakePHP projects

I'm trying to import existing Cake 1.2 projects into PHP Eclipse (latest all-in-one download on Galileo build) - I don't think I understand Eclipse properly: 1) I have created Workspace on my web root C:\Program Files\xampp\htdocs 2) I have created new Project C:\Program Files\xampp\htdocs\EclipseCake ... how do I import my existing ca...

JQuery AJAX returned too much data that I had not requested

Hi all, I am using CakePHP 1.26 and CDN JQuery in this URL: http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js In a HTML web page, I have these lines of code: $.ajax({ type: "POST", url: "http://mywebsite.com/controllers/avail/"+curl, success: function(data) { alert(data);} }); and in t...

confused of $this in cakePHP

Hi all, I got a few lines of codes in a Model in cakePHP 1.26: function beforeSave() { $this->data['User']['pswd'] = md5($raw['User']['pswd']); return true; } // this beforeSave() works The code above has been tested and it is working in my database. Yet, I am not sure if I can...

PHP Framework Benefits / Downfalls

I have been a PHP developer for about 10 years now and until about a month ago I have never used a framework. The framework I am now using due to an existing codebase is cakePHP 1.2 I can see certain benefits of the frameworks with the basic helpers like default layouts. I can deffinately seen the benefits of MVC keeping the logic sper...

form helper string concat converting zero to unset in cakephp

This has me beat. I'm trying to create an array of fields in cakePHP 1.2.5 & PHP 5.3.2 The array is zero based. On the first iteration, $count == 0. For some reason the string concatenation seems to convert this to null or unset which cake then interprets as "insert model name here", viz: for($count=0;$count<$num;$count++) { echo $fo...

if(something) vs if(something===true)

Hi all, I was doing some self-learning about cakephp (version 1.26). I got a simple HTML input text field like this: <input type="text" name="data[testing][name]" id="data[testing][name]"> The value from the Input text box field was checked against the database. If the value matches the data stored in the database, it will return tru...

$session->flash()

Hi all, I am using cakePHP v1.26. In the default.ctp file, I got a single of this code in it: $session->flash(); I came a corss a web site in which the author suggested using this instead: if($session->check('Message.flash')){ $session->flash(); } I do not understand what this line of code is doing: if($session->check('Message....