cakephp

Cake's ACL component and the concept of "ownership"

Hello, I have been futzing around with Cake's Auth/ACL components. I've read the docs and I've done the tutorial, but I am still not satisfied with what I can actually accomplish with it. I've seen a couple of other approaches, but I can't say as I really have a straight winner with either. In any tutorial/blog post/doc I read, the u...

trying to load second request causing problem ?

Hi i am getting the error of Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead [Break on this error] Failed to load source for: http://www.xyz.com/# i am loading external page in div using ajax call while first page its not causing any problem but when i load second one its ...

How do you make strings XML"safe"?

I am responding to an AJAX call by sending it an XML document through PHP echos. In order to form this XML document, I loop through the records of a database. The problem is that the database includes records that have '<' symbols in them. So naturally, the browser throws an error at that particular spot. How can this be fixed? ...

Using gettext in CakePHP model validation

Hi! Is there any possibility to use the gettext functionallity within the CakePHP model validation array? Usually a programmer would do it like this: class Data extends AppModel { var $validate = array( 'title' => array( 'NichtLeer' => array( 'rule' => array('between', 4, 20), 'allowEmpty' => false, 'message' => _('B...

savefield() created a new row or record rather than updating the specific record

Hi all, I am using cakePHP 1.26. I got some sample data in a Table which has got two field: {user_id, avatar} I was trying to update an old record in the database : $who=$this->Session->read('user.user_id'); // 12 was retrieved in this case $c = "http://www.abc.com/myimage.gif"; $this->Test->User->user_id = $who; $result = $this->T...

CakePHP, do database row DeleteAll where 1 field is equal to something and other field is NOT equal to something

I'm struggling with doing this, I want to basically do a database deleteAll where one field is equal to something and another field must NOT be equal to something.. its for deleting duplicate rows so I want to delete all but one row.. the way I tried below isn't working, I Would appreciate any advice: $conditions = array ( "Prox.prox...

CakePHP: Use some javascript in plugin is error

example 1 : I maked tinymce helper I intent use compress tinymce but it dont run valid if i insert tinymce javascript folder in plugin's webroot. It'll dont compress but if I move tinymce javascript to app's webroot it 'll run compress good. example 2: http://www.jstree.com/ . I must move it app's webroot , too If anyone saw this ca...

cakePHP or PHP with Plupload

I upload file = Plupload . I checked varibles $_FILES, $_POST, $this->data , all is empty and !isset please help me function mod_uploadImg($id = null){ if (!$id){ return false; } if (!empty($_POST)){ CakeLog::write('activity', 'file exist'); } if (isset($_FILES['file'...

CakePHP returning double array from find('list) query

I'm using cakephp and am getting back a "double array" where it is giving me 2 arrays where it should be 1, I have looked into the issue as far as cakephp and can't figure it out and just want to move past this for now so I am wondering if anyone knows how to unset a second array if a variable has 2 arrays.. below is the print_r of the a...

Role management user interface in cakePHP

hello folks, Is there any easy way to create a user interface to role management section(allow or deny permissions) for admin in cakePHP? easy way means any inbuid helper or something? ...

Best Web-Framework with jQuery-Integration

I'm struggling to find out which PHP-Frameworks does the best job when it comes to integrate with jQuery as Frontend-Framework. Zend seems to work best with Dojo, CakePHP with Prototype, but my favorite one JQuery seems nowhere to be supported out of the box. For example CakePHP has a pagination helper, but it works only with Prototype ...

CakePHP: how to access $this->set(array('fruit' => 'orange', 'vegetable' => 'kale')); in controller

I'm new to CakePHP and I'm looking at some code I've downloaded that has a function that looks like this: $this->set(array('fruit' => 'orange', 'vegetable' => 'kale')); In the code, the array variables are accessed in another controller function using this method: $varsSet = $this->viewVars; echo $varsSet['vegetable']; What I'd lik...

cakephp baking in windows 7

Hi, I'm new to cakephp so have just been working through the cookbook and am now working through "Beginning CakePHP from Novice to Professional" by Apress. I have got to the Bake section of the book but I can't seem to get it working in windows 7. I have added the path to my "Environment Variables" so I don't have to navigate to the lo...

CakePHP associations messing up

Hi, I am new to cakephp and have been working through the Apress book "Beginning CakePHP from Novice to Professional" but have ran into a problem after the baking chapter. (If you've seen my other recent question, you'll know that I had to skip that chapter because I cant get the bake console working on my win7 machine). The problem i...

Codeigniter and/or Cakephp Tutorials to build complete apps from scrach?

I've been playing around with this tutorial. It teaches you how to build a web app where people can find and post jobs using Symfony. Symfony has two tutorials to make completely functional apps from scratch (and their online demos): Jobeet and Askeet. I wonder if there are the same kind of tutorials for CakePHP and CodeIgniter? By th...

Validation rule for a composite unique index (non-primary)

I am sure I am not the first who has composite unique keys in tables and who wants to validate them. I do not want to invent the bicycle so I ask here first. I have several tables that have 'id' columns as primary keys and two other columns as unique composite keys. It would be nice to have a validation rule to check that the submitted e...

How to have cakephp Deliver content on different subdomain ?

I am building a portal which will have different cities content.. When someone comes to the website i want them to choose the city and then proceed to http://city1.site.com or http://city2.site.com can this be done using a single database and installation of cakephp ? ...

CakePHP - calling a component 's function from a view

Hi, How do I call a function from a component from a view? (ctp file) Is that even a good practice to do that? Thanks, Tee ...

Calling function in view of cakephp

Hi, I have one team array and want that team name every where to show team name.It is possible to built a global function which can return team name and I call that function from my view means ctp file. ...

CakePHP search in hasMany relations

Hello, I have a model Content which belongsTo Categories, hasMany Publishers, and Publisher belongsTo city. There is also a search form where someone selects from a drop-down box which category to view and which city. But how can I combine these two in a single paginate condition? I mean I cannot do something like: $this->paginate('Co...