Re: REST API in 2.x (authenticate for some actions, etc)

2012-10-22 Thread Ivan Rimac
you can use cURL for simulating post requests: $data = 'data[User][token]=87f77a583929c700119878128dc108bd62ca7772'; $data .= '&data[Ride][start_address]=Osijek, Croatia'; $data .= '&data[Ride][end_address]=Pula, Croatia'; $ch = curl_init('http://domain.com/controller/action.json'); curl_setopt(

Re: Allow special characters in HtmlHelper

2012-10-22 Thread Chetan Varshney
Use this for example $imgTag = $this->Html->image($image['Image'] ['thumb_path'], array( 'alt' => $title )); $options = array('class' => 'thumb', 'name' => trim(Inflector::slug($title)), 'title' => trim($title), 'escape'=>false); echo $this->Html->link($imgTag, $this->Html->url($image['Image'] ['s

Allow special characters in HtmlHelper

2012-10-22 Thread bs28723
I would like to use Html->image and Html->link together, but Html->link will convert characters like <, ", etc to htmlize them. for example             $imgTag = $this->Html->image($image['Image']['thumb_path'], array( 'alt' => $title ));    

Re: Get Data From Associations

2012-10-22 Thread ecko usil
Thanks guys, CounterCache more suitable for my case.. and its worked On Tuesday, October 23, 2012 12:36:42 AM UTC+7, jsundquist wrote: > > Specifically look at the following within the cake book > > > http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-dest

REST API in 2.x (authenticate for some actions, etc)

2012-10-22 Thread Zap
Hi everyone. The webfront of my website is ready, but I want to give access to core functions via an API. Thing is, for public data (like juse rinfo and such), I already used request handler to have json or XML special views, so I guess that's ok. But, I was wondering how to achieve POST actio

HttpSocket in Ajax

2012-10-22 Thread Ingvar
I'm having promlem with sending post request in ajax request handler. In ajax request handler the body of response is always null, in the regular request handler it's not null. How to send http requests in ajax request handler? class DataController extends AppController { public function aj

Re: Making database queries secure

2012-10-22 Thread Jamie
The best way to secure your update and insert queries? Use the proper model interface, i.e. save(), saveAll(), etc. On Monday, October 22, 2012 6:22:54 AM UTC-7, Daniel wrote: > > I do some custom database queries using some values derived from a call to > find. I think I should make these more

Re: Get Data From Associations

2012-10-22 Thread Jonathan Sundquist
Specifically look at the following within the cake book http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly On Mon, Oct 22, 2012 at 12:29 PM, Jonathan Sundquist wrote: > Change the join type to an outer join instead of a

Re: Get Data From Associations

2012-10-22 Thread Jonathan Sundquist
Change the join type to an outer join instead of an inner join. In order to do this within your controller before you make the query you will need to flip either your belongsTo or hasMany depending on which way you have your model set up. On Mon, Oct 22, 2012 at 12:27 PM, lowpass wrote: > I thi

Re: Get Data From Associations

2012-10-22 Thread lowpass
I think the simplest approach would be to use counterCache. Then you could do a find on Categories where the count is 0. On Mon, Oct 22, 2012 at 1:00 PM, ecko usil wrote: > Categories has many articles. How can I get list all categories with > conditions categories doesn't have any articles? > >

Get Data From Associations

2012-10-22 Thread ecko usil
Categories has many articles. How can I get list all categories with conditions categories doesn't have any articles? thanks in advance. regards ucil -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you

RE: Change Image Path

2012-10-22 Thread Advantage+
Worked perfect! Thanks. Dave From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Vanja Dizdarevic Sent: Monday, October 22, 2012 3:12 AM To: cake-php@googlegroups.com Subject: Re: Change Image Path The core bootstrap (lib/Cake/bootstrap.php) is loaded bef

Request gets blackholed.

2012-10-22 Thread Advantage+
I have a standard function in AppController that's used for various controllers to simply order / re-order users records for various controller. There are no views as the ordering (drag and drop ) is done on the manage_index view for what ever controller. It worked in 1.3 but migrating to 2.2.3 a

Re: Making database queries secure

2012-10-22 Thread Felipe Zavan
I don't know about cleaning the query data, but you really should be using cake methods. Is there any special reason you don't? 2012/10/22 Daniel : > I do some custom database queries using some values derived from a call to > find. I think I should make these more secure using a security functi

Making database queries secure

2012-10-22 Thread Daniel
I do some custom database queries using some values derived from a call to find. I think I should make these more secure using a security function, but I am not sure which function to use. Should I use Sanitize or mysql_real_escape_string, and what parameters should I pass? Here is the relev

Re: Copy branch of Tree to another parent

2012-10-22 Thread bs28723
Sorry, if my question was not clear. I want to "copy" the entire branch to another location. So, if I want to copy a branch that has 5 children, then I need to create the new parent node first, then once I have this ID, I can then create the 5 children nodes. That is a fairly easy example. But

Re: How can i edit a record?

2012-10-22 Thread Nattapong Suwansukho
?? AUTO_INCREMENT :-) ? 22 ?? ?.?. 2012, 15 ?? 57 16 ?? UTC+7, suttipong Pratum : > > u must show filed id in edit view page or hidden filed when > submit and call save() cakephp auto update > > > ?

Re: How can i edit a record?

2012-10-22 Thread Nattapong Suwansukho
Thx for you suggestion , i've really forgot to set AUTO_INCREMENT. :-) เมื่อ วันอาทิตย์ที่ 21 ตุลาคม ค.ศ. 2012, 11 นาฬิกา 7 นาที 55 วินาที UTC+7, Wallace Cardoso Colaço Ricardo เขียนว่า: > > The field ID has to be Primary Key and AUTO_INCREMENT. > > You need to change the table countries > > On O

CakeResponse::expires() Fatal Error

2012-10-22 Thread gimmebucks
I'm using cake 2.2.2 and trying to set expires headers. in my AppController.php > public function beforeRender(){ > CakeResponse::expires(new DateTime('+5 day')); > } but i got this error > *Fatal error*: Call to undefined method > CakeErrorController::_getUTCDate() in * > F:\www\mail-us\lib\C

How to get posts that match specified several tags

2012-10-22 Thread Anna P
Hello. I'm creating a search engine for a blog and I've got a problem with selecting posts based on a given, several tags. I have following models: - Post (posts) - Tag (tags) - PostsTag (posts_tags) In Post model there is a hasAndBelongsToMany relationship with Tag model defined. Let's say

Re: How can i edit a record?

2012-10-22 Thread suttipong Pratum
u must show filed id in edit view page or hidden filed when submit and call save() cakephp auto update ? ?? pk ??? table hidden filed ??? view ?? ? sumit controller ??? new data

Re: Locale prefix

2012-10-22 Thread Ivan Rimac
Nema na čemu! :-) I had to do only once, and I had dedicated server at my disposal, so it was relatively easy for me to do it in this way. I did not want to mess with i18n database strucuture, and all of that things, so I dont have experience with other ways how to do it. So i am not able to help

Re: is it possible create schedule post with cakephp?

2012-10-22 Thread ecko usil
This is my case: I create some task with date time > now(), it means scheduled task. When task time is coming that task will run another task. ex: Create some email message now but scheduled for sent next week to multiple accounts. thanks all for your reply. Any code sample will help me a lot

Re: is it possible create schedule post with cakephp?

2012-10-22 Thread Vanja Dizdarević
...you mean published < NOW() ... That typo cost me 5 minutes of thinking. :D -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this gr

Re: is it possible create schedule post with cakephp?

2012-10-22 Thread AD7six
On Monday, 22 October 2012 05:37:19 UTC+2, ecko usil wrote: > > Thanks kani for your answer, I know that cakephp is not CMS. In my case, I > just develop application with cakePHP and I want scheduling some task, and > automate update some action when scheduled time is coming. What can I say, >

Re: Locale prefix

2012-10-22 Thread Vanja Dizdarević
Hvala Ivane! :D The code helps a lot. Subdomains were also my first impulse. But it is much easier for me to have it on the same domain for multiple reasons (security certificates, seo, cross-domain requests, practical urls, css/js/img caching, sessions, portability, etc). Anyways, I'm curren