cakephp

CakePHP Media plugin with php safe_mode

Hi, i'm trying CakePHP( 1.2.6 ) and Media plugin( 0.60 ) on shared server with php_5.2.5( safe_mode : On ). And upload jpeg file by media plugin, following error message apear on attachments.ctp( media plugin's element ). An error occured while transferring the file. How can i fix this error without php cgi_mode on shared server...

adding a logo in cake framework by editing default.ctp

where do i put the code for the image, then where would i put the actual image file itself <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <?php echo $html->charset(); ?> <title> <?php __...

Using Git with your CakePHP Project

I use git as my primary version control system, and have recently started using git on my CakePHP projects. This is my current .gitignore file: app/tmp vendors/ As used in the cakephp git repo, but this causes a bit more work for me when deploying the project to a server, because I have to go in and create all the app/tmp/ sub-direct...

CakePHP ACL confusion, how do I apply ACLs to objects, not actions?

Can anyone suggest a scalable design pattern for implementing access control on Photos and Albums, each with individual privacy settings (i.e. owner, group member, public)? I'm using CakePHP, and the examples I have read on the ACL component seem to control access to controller/actions, not objects themselves. It seems to get out of ha...

cakephp appmodel save question

I'm just getting familiar with cakephp (thanks to the developer before me), and ran into something funny. I have finally found out what went wrong, but still do not know why. In very pseudo code: a controller function calls bar() twice in the same scope: $value = 'A'; $this->foo->bar($value); // do other stuff $value = 'B'; $this->foo-...

Subqueries while using Linkable or Containable Behaviors in CakePHP?

Hi is there a way to create a subquery while using the Linkable or Containable behavior with CakePHP? Thanks in advance! ...

CakePHP is truncating a text field, probably encoding related

Here's what I'm trying to do: I'm parsing incoming email, and using it to create posts in the system. This works almost completely, but there's a few bugs to work out. The one that's currently giving fits is coming up when an email contains certain characters (for example, ® – “ ”), the email body is being truncated at the special cha...

Redirecting paginator->sort to the first page in Cakephp

How do I do a paginator sort and also specify it to go to the first page: echo $paginator->sort('Make', 'Car.make'); If you're on page 6 and want to sort the list by car make. It sorts the list but puts you on page 6 of the sorted list. When someone clicks on the sort by "make" button, I want the paginator to take them to page 1 of th...

How to use OR Condition in Paginate function in Cakephp ??

Hi! I am facing a problem while fetching values using paginate function in cakephp. In the "to" field of message I have CSV fields of userid. To search messages for a single user. I am using the code below... $this->set('message', $this->paginate('Message', array( 'or'=> array( "Message.to LIKE" => "".$this->Session->read('...

file upload cakephp

when uploading an image to the server using cakephp $this->Model->Behaviors->attach('ImageUpload', Configure::read('photo.files')); photo uploaded successfully, and the database fields also but shows following error instead of returning to index page. Notice (8): Undefined index: class [CORE\cake\libs\model\behaviors\upload.php, l...

City belongsThroughCountyTo Province association, how to simplify the code?

Tables: Province hasMany County, County belongsTo Province, County hasMany City, City belongsTo County So basically something like: City belongsThroughCountyTo Province Situation: In a search form I have a select drop down menu with provinces. The "code": When I list the results, I first get ids of counties that belong to the speci...

Kayak-like filter sliders using jQuery and AJAX pagination in CakePHP

Hey everyon, I was looking at this tutorial and was wondering if anyone has an example of the completed effect. I just want to know if it filters through the result when using the sliders but also updates the paginated numbers like on the kayak site. So lets say there is 10 pages, then you use the filter and then there are 5 pages. If ...

cakePHP, Model Recursion.

I have a few models, all with appropriately named model files. $this->Property->PropertyImage->Image->read(); All linked accordingly. Problem is, the recursive model is not able to attach to all the relationships and for some reason is returning AppModel data type when i do a var_dump on $this->PropertyImage. When i do a var_dump($thi...

CakePHP: Error: Database table cake_errors for model CakeError was not found.

Hi Guys, I have a CakePHP error and I having a hard time to trace the problem. Hope you can help me. Here is the error message: Missing Database Table Error: Database table cake_errors for model CakeError was not found. Notice: If you want to customize this error message, create app/views/errors/missing_table.ctp Am I missing somethi...

building dynamic form in cakephp

I'm trying to build a form dynamically based on the field and its definitions stored in a XML file. In my xml, I have defined 1 checkbox with some label and 1 textfield with some label. How do I build a form dynamically based on what I have in my xml. I dont want to create any models. ...

cakePHP basic ajax form problem

i am trying to do a simple form that adds a new comment using ajax to a blog post (actually this is a part of a cakePHP tutorial) but the problem is that the submit button do nothing at all here is the part of code that generates the form in the view.ctp file <?php echo $ajax->form('/comments/add', 'post', array('url' => '/comments/ad...

Automated sitemap in CakePHP

I'm following this tutorial for creating automated sitemaps in CakePHP. Everything is easy, but I'm not able to output XML. The controller looks like function sitemap () { Configure::write ('debug', 0); $cats = $this->Category->find('all', array('fields' => array('nicename', 'modified')), null, -1); $posts = $this->Post->fin...

After escaping html chars with CakePHP's Santiize::html() is it secure to unescape chars like *() inorder for the markdown parser to work?

Before displaying user posts I run them though Sanitize::html() to escape all html. But it escapes some of the chars that are used for the Markdown parser. This is what I want: I'm testing this markdown. Try clicking here This is what I get: I'm testing this markdown. Try [clicking](http://www.google.com&#41; here So I'm wondering if...

proper place of Configuration::load() in CakePHP

I wish to load some global defaults in my CakePHP application. E.g. app/config/defaults.php $config['site']['name']='FooBar'; $config['secuity']['somelimit']=-1; I'm going to use (Configuration::read()) these values across various classes not just in a single controller. Where is the proper place to call Configuration::load('defaults...

PHP sending HTML to JS

I have a div on the page where the contents change depending on the value selected in a drop down. Because there is a large amount of formatted content in this div I want to have a php script supply html which is stored in a file on the system. I can't seam to figure out how to have php return the contents of that file, which essentiall...