i have a tweet table that stores tweets and its replies like this
tweet(id, parent_id, tweet_message, time)
where parent_id is a self id if its a tweet and is of parent id if its a reply. how to do a find to pull out tweets where id = parent_id
example:
tweet(1, 1, 'My name is Harsha', 'time') parent_id = id since its a tweet and...
I am trying to get multiple rules to run during an upload validation. One validation is built in and one is custom. The custom one works fine however the built in one is not working. The custom one extension was working on another field earlier just fine. Do I have this setup correct?
var $validate = array(
'description' => ...
I'm learning cakephp for some time and it's very nice, I'm using the cake bake to create my classses.
Suppose I have a animal entity and a food entity and they have a many to many relation, and I'm on the add animal view, how can I add the option to add 3 new foods to this animal on this view? and what should the controller code look li...
I wanted to now if there is a way to pass a simple string inside url and cakephp some how put it inside one of the inputs of my form without any code writing on view side?
I tried calling this->set("bla","bla"); the field name is bla
but nothing changed in view
...
I'm using CakePHP 1.3, and trying to make a simple message posting board with ajax. I'm trying to use the Js helper to submit a form on the index page, then refresh the message board's div to include the new message. This is all on a single page.
I have previously posted on this, but I wanted to rephrase the question and include some u...
hi,
I'm making my first CakePHP project (apart from all the tutorials I did...).
I'm making a site for trainers and athletes in the athletics sport.
now in my database I have a user table with fields: id, username, firstname, lastname, email, password, ...
then I have 2 other tables with the fields:
trainers: id, type_id(sprint, dis...
Hi everyone!
I am using this awesome framework during 6 months and I learnt a lot about it, but I wonder if it's possible to create an internal structure to simulate modules like in Codeigniter. I know there is the possibility to use plugins for that, but it seems too difficult to connect it together and pass info between them.
My goal...
I am using:
$this->Session->setFlash('gotcha!!', 'msg_success');
to write a msg in the Session and try to access it in the file
\app\views\elements\msg_success.ctp
with the code
if($session->check('Message.flash'))
{
echo $session->flash();
}
My Phpinfo() says
memory_limit 512M 512M
My app/config/core.php says
...
Hi,
I've been trying to figure out how to do this functionality but it's a lot harder than I thought.
Can anyone give me a pointer / point me to an existing component on how I can achieve the functionality in the image attached?
So what I have is, I have a Model called Instruction. And Instruction has Steps. Below is the form for St...
I am trying to get the latest modified "posts", from a group of "posts", that all have the same parent_id. I already learned today that grouping is not the answer, and that I should either use an inner subquery, or a "within-group aggregate", thanks to this site >> Aggregates >> Within-group aggregates. I chose to go with the latest, as...
I've just set up a new Ubuntu 10.4 slice on Slicehost, and have installed apache, mysql and php. I've uploaded my CakePHP app and everything is running fine, except for the webroot being inaccessible. I have tried adding AllowOverride to all in /etc/apache2/sites-available/default and followed the Cake instructions to httpd.conf by addi...
What is the best way to do and equivalent to CakePHP's beforeFilter() in codeIgniter
...
i am getting this error when i try the following Statement
Statement
$status = $this->User->StatusMessage->find('first', array(
'contain' => array(
'StatusMessageReply' => array(
'User' => array('condition' => array('User.id' => 1 ))
)
)
));
Error
Model "User" is not associated with model "Use...
When a user clicks a link that requires a log in, we currently redirect them to the log-in page ,but we lose the intended URL. What is the best way to account for that URL and redirect the user to the requested page once logged in?
We're using the latest stable version of Cake. Thanks.
--Edit--
Its configured like this
$this->Auth->...
I am storing values in my session in one of my AJAX calls. The session is getting overwritten correctly. But when I make some other call (AJAX or non-AJAX), the session value is lost. This doesn't happen every time but in most of the cases.
My security level is on medium already.
here is the controller function and the view : http://bi...
Gallery model
var $validate = array(
'id' => array('rule' => 'numeric', 'required' => true, 'allowEmpty' => false, 'on' => 'update'),
'name' => array('rule' => 'notEmpty', 'required' => true, 'allowEmpty' => false, 'on' => 'create'),
'model' => array('rule' => 'notEmpty', 'required' => true, 'allowEmpty' =...
I'm building a site with CakePHP, but this question is more about solving an MVC problem than it is a CakePHP problem.
I have a User Model and a Group Model. This is a HABTM relationship, so different users may belong to multiple groups. One controller on my website handles the blog. It has many methods, but all of the views share a ...
I have a site using cakephp1.2.8 running on a ubuntu9.04 server. It works fine with 16M memory_limit. Now I moved the site to a new CentOS5.5 VPS. Then the server starts to show errors like this:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 342095888 bytes) in Unknown on line 0
It displays pages cor...
Hi
Thanks for your time.
I am developing application using PHP. In this for some instace I have added logic such that, for certain area matches then redirect to particular url.
if(//statement) {
redirect to specific URL(e.g. http://www.example.com/testing.php )
}
Above is my basic logic. Here I want to Identify that whether use...
Hi There,
I've added a tooltip feature to my application because parts of the ordering system can be confusing to some of our newer users, it's simple jQuery:
$(document).ready(function(){
$('input, select, textarea').focus(function(){
$class = $(this).attr('title');
$('.tooltip_' + $class).fadeIn(500);
});
...