Re: Cakephp + TCPDF

2012-07-29 Thread Elisio Leonardo
You should really try to use Cakepdf Plugin.

https://github.com/ceeram/CakePdf

On Thursday, July 26, 2012 12:04:32 AM UTC+2, gloop wrote:
>
> Hello,
>
> i would like to create a pdf. Now i found this:
>
>
> http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf
>
> So i try this example:
>
> Step: 1, 2, 3 the same as the example
>
> Step 4:
>
>   function viewPdf() {
> $this->layout = 'pdf'; //this will use the pdf.ctp layout
> $this->render(); 
> } 
>
> Step 5:
>
>  App::import('Vendor','xtcpdf');  
> $tcpdf = new XTCPDF(); 
> $textfont = 'freesans'; // looks better, finer, and more condensed than 
> 'dejavusans' 
>
> $tcpdf->Cell(0,14, "Hello World", 0,1,'L'); 
> echo $tcpdf->Output('filename.pdf', 'D'); 
> ?>
>
> When i open function in a browser i get a download popup and i have to 
> choose how i would open the document. The standard software is "firefox".
>
> I try 
>
> echo $tcpdf->Output('filename.pdf', 'D');
>
> and i see many text (like i open the pdf with firefox. I check the http 
> header and see the document is opend with Content-Type: text/html; 
> charset=UTF-8
>
>
> I try:
>
> In the controller $this->header('Content-type: application/pdf'); andheader(
> 'Content-type: application/pdf');
>
> But i get always the wrong content-type.
>
> How i can change the content type?
>
> Thanks for help.
> gloop
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP REST service does not recognize POST

2012-07-29 Thread Dr. Tarique Sani
Create a form and post it to the URL and work forwards from there. -
could be something wrong with the extension.

The ->isPost() method is very simple and just uses
$_SERVER['REQUEST_METHOD'] to check the method

HTH
Tarique



On Fri, Jul 27, 2012 at 1:59 AM, frederikjacques  wrote:
> Hi all,
>
> I'm trying to get my REST services up and running, the routing works, but
> when i do a POST to my service, the RequestHandler->isPost() function
> returns false.
> Could somebody help me out what I'm doing wrong???
>
>> Routes.php
>>
>> Router::connect(
>>
>> '/authenticate',
>>
>> array(
>>
>> 'controller' => 'users',
>>
>> 'action' => 'login',
>>
>> '[method]' => 'POST')
>>
>> );
>>
>>
>> Router::parseExtensions('json');
>
>
>>  Login function in UsersController.php (for demo purpose i just return if
>> it detects a post or not)
>>
>>  if( $this->RequestHandler->isPost() ) {
>> $this->set('loginResult', 'post');
>> $this->set('_serialize', array('loginResult'));
>>  }else{
>> $this->set('loginResult', 'no post');
>> $this->set('_serialize', array('loginResult'));
>>  }
>
>
> Now I use REST Console extension in Chrome to do a call to my REST service
> (http://path_to_localhost_website/authenticate)
> This is the result returned:
>
> Request Headers
>
> Accept: application/json
> Content-Type: application/json
> Connection: keep-alive
> Origin: chrome-extension: //rest-console-id
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0)
> AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
>
>
> Request Body
>
> Request Url: http://localhost/ris/winsol/winsol_admin/authenticate
> Request Method: POST
> Status Code: 200
> Params: {
> "email": "frede...@the-nerd.be",
> "password": "fd12d90f5670211f5bd4f2816baa7299eb256e1f"
> }
>
>
> Response Headers
>
> Status Code: 200
> Date: Thu, 26 Jul 2012 20:25:41 GMT
> X-Powered-By: PHP/5.3.6
> Connection: Keep-Alive
> Content-Length: 25
> Server: Apache
> Content-Type: application/json
> Keep-Alive: timeout=5, max=99
>
>
> Response Body:
> { "loginResult": "no post" }
>
> I hope somebody can help me out, because it is driving me mad :-)
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp + TCPDF

2012-07-29 Thread Daniel Baird
I'm not familiar with PDF generation, but surprising HTML headers are
sometimes an "early output" problem.

So check for stray spaces and newlines in your php files.  Depending on
config, if your app emits any output, even whitespace, PHP sends the
headers as it knows them at the time -- if your whitespace appears early,
that might be some default html headers.

d
-- 
Daniel Baird
I've tried going to the XHTML  a few times, but it's always closed.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Mariano C.
It's working now, but I followed the name convention as written on cake 
site.

Il giorno domenica 29 luglio 2012 22:48:52 UTC+2, WyriHaximus ha scritto:
>
> Why would do you that when you can make the JsonView take care of that:
>
> $this->set(array(
> 'people' => $people,
> '_serialize' => array('people')
> )); 
>
> On Sunday, July 29, 2012 9:41:24 PM UTC+2, Walter Raponi wrote:
>>
>> $this->set(array(
>> 'people' => $people,
>> '_serialize' => array('person')
>> ));
>>
>> Do we need serialize?? 
>>
>> Just try $this->set('person', $people);
>>
>> And in view 
>> Echo json_encode($person);
>>
>>
>>
>> =
>> *Walter Raponi*
>> Din S.r.l.
>> Via Donato Menichella 304
>> 00156 Roma - Italy
>>
>> Tel  0641227662
>> Fax 0641227664
>> w.rap...@ritoll.it
>>
>> Il giorno 29/lug/2012, alle ore 19:01, "Mariano C." <
>> mariano.calan...@gmail.com> ha scritto:
>>
>> Yes I've read that message, but I don't understand what it means. Why I 
>> get that error only in json and xml output and not in a normal view?
>>
>>
>> Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
>>>
>>>
>>>
>>> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:

 Nothing change, I got the same error. :(


>>> Read the error message:
>>>
>>> Notice (8): Undefined index: person 
>>> [CORE\Cake\View\JsonView.php, line 89 
>>>
>>  -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/cake-php
>>
>>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Linking Models Together

2012-07-29 Thread Tilen Majerle
it always search for primary key, set $primaryKey variable in model to your
column
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/7/29 newt_e 

> Hi,
>
> I've have two tables:
> authors, has a column called id (amongst others)
> books, has columns called id and authorid  (amongst others)
>
> Obviously a book has an author, so any value of authorid must exist in the
> authors table.
>
> When I retrieve an authors row, I also want to return the corresponding
> authors row (books.authorid = authors.id).
>
> However, when trying to update my Book model, it always seems to link from
> the id column - how do I make it work against a different column?
>
> Cheers,
> N.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread WyriHaximus
Why would do you that when you can make the JsonView take care of that:

$this->set(array(
'people' => $people,
'_serialize' => array('people')
)); 

On Sunday, July 29, 2012 9:41:24 PM UTC+2, Walter Raponi wrote:
>
> $this->set(array(
> 'people' => $people,
> '_serialize' => array('person')
> ));
>
> Do we need serialize?? 
>
> Just try $this->set('person', $people);
>
> And in view 
> Echo json_encode($person);
>
>
>
> =
> *Walter Raponi*
> Din S.r.l.
> Via Donato Menichella 304
> 00156 Roma - Italy
>
> Tel  0641227662
> Fax 0641227664
> w.rap...@ritoll.it
>
> Il giorno 29/lug/2012, alle ore 19:01, "Mariano C." <
> mariano.calan...@gmail.com> ha scritto:
>
> Yes I've read that message, but I don't understand what it means. Why I 
> get that error only in json and xml output and not in a normal view?
>
>
> Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
>>
>>
>>
>> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
>>>
>>> Nothing change, I got the same error. :(
>>>
>>>
>> Read the error message:
>>
>> Notice (8): Undefined index: person 
>> [CORE\Cake\View\JsonView.php, line 89 
>>
>  -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> at http://groups.google.com/group/cake-php
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Linking Models Together

2012-07-29 Thread newt_e
Hi,

I've have two tables:
authors, has a column called id (amongst others)
books, has columns called id and authorid  (amongst others)

Obviously a book has an author, so any value of authorid must exist in the 
authors table.

When I retrieve an authors row, I also want to return the corresponding 
authors row (books.authorid = authors.id). 

However, when trying to update my Book model, it always seems to link from 
the id column - how do I make it work against a different column?

Cheers,
N.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Registering With the Bakery on the CakePHP website

2012-07-29 Thread newt_e
Has anyone else had problems registering on the CakePHP website?

The verification email contains a link that doesn't work so I can't do the 
verification part - is it just me?

N.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Walter Raponi
$this->set(array(
'people' => $people,
'_serialize' => array('person')
));

Do we need serialize?? 

Just try $this->set('person', $people);

And in view 
Echo json_encode($person);



=
Walter Raponi
Din S.r.l.
Via Donato Menichella 304
00156 Roma - Italy

Tel  0641227662
Fax 0641227664
w.rap...@ritoll.it

Il giorno 29/lug/2012, alle ore 19:01, "Mariano C." 
 ha scritto:

> Yes I've read that message, but I don't understand what it means. Why I get 
> that error only in json and xml output and not in a normal view?
> 
> Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
> 
> 
> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
> Nothing change, I got the same error. :(
> 
> 
> Read the error message:
> 
> Notice (8): Undefined index: person 
> [CORE\Cake\View\JsonView.php, line 89 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeEmail Connection Refused on Live Server

2012-07-29 Thread Fahad Khalid Bhatti
Any success??

On Sunday, November 27, 2011 8:59:26 AM UTC+5, andrewperk wrote:
>
> Hello,
>
> I'm using CakeEmail to send emails using Gmail and their SMTP. On my
> local environment it sends emails just fine with no errors. I'm not
> sure why it would work locally and note remotely. But when I upload it
> to the server I get the following error( the send_email() method is
> one I made to just pass in the 'to', 'from', 'viewVars', etc..):
>
> Connection refused
>
> Error: An Internal Error Has Occurred.
> Stack Trace
>
> #0 /home/content/76/5924776/html/lib/Cake/Network/Email/
> SmtpTransport.php(94): CakeSocket->connect()
> #1 /home/content/76/5924776/html/lib/Cake/Network/Email/
> SmtpTransport.php(59): SmtpTransport->_connect()
> #2 /home/content/76/5924776/html/lib/Cake/Network/Email/
> CakeEmail.php(966): SmtpTransport->send(Object(CakeEmail))
> #3 /home/content/76/5924776/html/app/Controller/AppController.php(64):
> CakeEmail->send()
> #4 /home/content/76/5924776/html/app/Controller/
> PostsController.php(121): AppController->_send_email('send_to_friend',
> 'html', 'andrewperk@gmai...', 'newvenuswebsite...', 'James has
> sent ...', Array)
> #5 [internal function]: PostsController->stf()
> #6 /home/content/76/5924776/html/lib/Cake/Controller/
> Controller.php(473): ReflectionMethod-
> >invokeArgs(Object(PostsController), Array)
> #7 /home/content/76/5924776/html/lib/Cake/Routing/Dispatcher.php(107):
> Controller->invokeAction(Object(CakeRequest))
> #8 /home/content/76/5924776/html/lib/Cake/Routing/Dispatcher.php(89):
> Dispatcher->_invoke(Object(PostsController), Object(CakeRequest),
> Object(CakeResponse))
> #9 /home/content/76/5924776/html/app/webroot/index.php(96): Dispatcher-
> >dispatch(Object(CakeRequest), Object(CakeResponse))
> #10 {main}
>
> If you'd like to see specific code let me know. It's basically just
> cut/paste from the 2.0 book though changing out my own gmail settings
> and my own view file.
>
> Thanks for any help.
>
> Andrew
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Mariano C.


Yes I've read that message, but I don't understand what it means. Why I get 
that error only in json and xml output and not in a normal view?


Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
>
>
>
> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
>>
>> Nothing change, I got the same error. :(
>>
>>
> Read the error message:
>
> Notice (8): Undefined index: person 
> [CORE\Cake\View\JsonView.php, line 89 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Mariano C.
Yes. I've read. But what cause that errror? What that error really means?

Il giorno domenica 29 luglio 2012 18:35:37 UTC+2, rchavik ha scritto:
>
>
>
> On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
>>
>> Nothing change, I got the same error. :(
>>
>>
> Read the error message:
>
> Notice (8): Undefined index: person 
> [CORE\Cake\View\JsonView.php, line 89 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cakephp 2.X image and gallery plugin?

2012-07-29 Thread bs28723
Before I build it myself, I am looking for a plugin or something I can
start from that will upload images, create galleries or albums to manage
a collection of images.

I have done a number of search and there are plugins to do multiple
uploads, or attach images to a model. There are jquery plugins, but I
have not found anyone that has put some of this together.

Any suggestions?

Thanks,
Bill





--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Cakephp-2-X-image-and-gallery-plugin-tp5709959.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread rchavik


On Sunday, July 29, 2012 10:35:23 PM UTC+7, Mariano C. wrote:
>
> Nothing change, I got the same error. :(
>
>
Read the error message:

Notice (8): Undefined index: person 
[CORE\Cake\View\JsonView.php, line 89 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake PHP User Management Plugin Eagle

2012-07-29 Thread Steve Found

On 28/07/12 19:24, euromark wrote:

can somebody pleeaase stop this spam nonsense?

+1 to this !



Am Donnerstag, 26. Juli 2012 20:32:19 UTC+2 schrieb Ivan Suzen:

Hi Guys...

I have purchased User Management Plugin from
http://umpremium.ektasoftwares.com/
 site. I went through the
demo version of so called eagle plugin on
http://www.eagle.getyourplugin.com/login
. I found that it has
been copied from original plugin which is available at
http://umpremium.ektasoftwares.com
. The original plugin has
been launched on 16th April, 2012. So guys before buying this
plugin from http://www.eagle.getyourplugin.com/
 please go through
http://umpremium.ektasoftwares.com
/ and you can easily find out
 that eagle plugin is pirated version of original plugin.

Regards,
Ivan


On Sunday, July 15, 2012 8:21:27 PM UTC+5:30, Steve wrote:


hi guys, we have launched an amazing Plugin "Eagle" for Cake
PHP. It is user management Plugin which has 56 features. It
also gives you Login with FB, Twitter, LinkedIn, Foursquare,
Google and Yahoo. You can read all its features here:
http://developers.getyourplugin.com/features.html
 and you
can check the Plugin here: http://www.eagle.getyourplugin.com
 , you can test the Plugin
on this link: http://www.eagle.getyourplugin.com/login
 , default username
and password is 123456, check it and tell us the feedback.

Regards,
Steve

--
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and 
help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakePHP hasAndBelongsToMany relationships demystified

2012-07-29 Thread Ralf Rottmann
Hi everybody,

After days of trial-and-error and almost giving up, I've managed to get 
some basic and – as I believe – very common scenarios solved in CakePHP. I 
was wondering, why the documentation is not clear on these aspects, so I 
described my findings in a somewhat lengthy blog post.

You might find this helpful: 
http://www.24100.net/2012/07/cakephp-hasandbelongstomany-relationship-queries-demystified/
.

I'm addressing a couple of questions:

   - Scenario where a User and a Group model share a bidirectional 
   hasAndBelongsToMany relationship.
   - Saving a user with *multiple groups*.
   - Querying for a user *who is a member of a specific group AND at the 
   same time filtering on fields of the User model.*
   - Adding *additional groups* for an existing user *and keeping the join 
   table up-to-date.*

As I've read hundreds of questions somewhat related to this scenario on 
Stack Overflow, I assume there must be others out there, trying to wrap 
their heads around this.

I hope it helps.

Open for any conversation on Twitter, find me @ralf
.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Mariano C.
Nothing change, I got the same error. :(

Il giorno domenica 29 luglio 2012 16:49:36 UTC+2, Mariano C. ha scritto:
>
> I'm try to develop a simple webservices in CakePHP 2.1. So, i first 
> created a DB table:
>
> CREATE TABLE IF NOT EXISTS `people` (
>>   `id` char(36) COLLATE utf8_bin NOT NULL,
>>   `first_name` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>>   `last_name` varchar(100) COLLATE utf8_bin NOT NULL,
>>   `home_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>>   `job_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>>   `phone` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>>   `fax` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>>   `mail` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>>   `birth_date` int(11) DEFAULT NULL
>> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin 
>
>
> Than I've created a simple Person model:
>
> > class Person extends AppModel {
>> public $name = 'Person';
>> }
>
>
> And respective controller:
>
> > class PeopleController extends AppController {
>> public $components = array('RequestHandler');
>> 
>> public function index() {  
>> $people = $this->Person->find('all');
>> $this->set(array(
>> 'people' => $people,
>> '_serialize' => array('person')
>> ));
>> }
>> }
>
>
> and finally, in routes.php, I've mapped the proper roote:
>
> > Router::mapResources('people');
>> Router::parseExtensions('json');
>> Router::connect('/', array('controller' => 'pages', 'action' => 
>> 'display', 'home'));
>> Router::connect('/pages/*', array('controller' => 'pages', 'action' 
>> => 'display'));
>> CakePlugin::routes();
>> require CAKE . 'Config' . DS . 'routes.php';
>
>
> but when I try to reach ht_tp://localhost/cakephp/people.json I get:
>
> > onclick="document.getElementById('cakeErr501541d86308c-trace').style.display 
>> = (document.getElementById('cakeErr501541d86308c-trace').style.display == 
>> 'none' ? '' : 'none');">Notice (8): Undefined index: person 
>> [CORE\Cake\View\JsonView.php, line 89]> id="cakeErr501541d86308c-trace" class="cake-stack-trace" style="display: 
>> none;">> onclick="document.getElementById('cakeErr501541d86308c-code').style.display 
>> = (document.getElementById('cakeErr501541d86308c-code').style.display == 
>> 'none' ? '' : 'none')">Code > onclick="document.getElementById('cakeErr501541d86308c-context').style.display
>>  
>> = (document.getElementById('cakeErr501541d86308c-context').style.display == 
>> 'none' ? '' : 'none')">Context> class="cake-code-dump" style="display: none;">$this->autoRender = false;
>> $this->View = $View;
>> $this->response->body($View->render($view, $layout));>  
>> id="cakeErr501541d86308c-context" class="cake-context" style="display: 
>> none;">$view = null
>> $layout = null
>> $serialize = array(
>> (int) 0 => 'person'
>> )
>> $data = array()
>> $key = 'person'> class="stack-trace">JsonView::render() - CORE\Cake\View\JsonView.php, line 
>> 89
>> Controller::render() - CORE\Cake\Controller\Controller.php, line 957
>> Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 193
>> Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 161
>> [main] - APP\webroot\index.php, line 
>> 92{"person":null}
>
>
> Where is the error?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [2.1] Problem with webservices

2012-07-29 Thread Walter Raponi
Missing view under View/People/json/index.ctp

Just echo json_encode($people); there and you should get yout json data


=
Walter Raponi
Din S.r.l.
Via Donato Menichella 304
00156 Roma - Italy

Tel  0641227662
Fax 0641227664
w.rap...@ritoll.it

Il giorno 29/lug/2012, alle ore 16:49, "Mariano C." 
 ha scritto:

> I'm try to develop a simple webservices in CakePHP 2.1. So, i first created a 
> DB table:
> 
> CREATE TABLE IF NOT EXISTS `people` (
>   `id` char(36) COLLATE utf8_bin NOT NULL,
>   `first_name` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `last_name` varchar(100) COLLATE utf8_bin NOT NULL,
>   `home_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `job_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `phone` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>   `fax` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>   `mail` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `birth_date` int(11) DEFAULT NULL
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin 
> 
> Than I've created a simple Person model:
> 
>  class Person extends AppModel {
> public $name = 'Person';
> }
> 
> And respective controller:
> 
>  class PeopleController extends AppController {
> public $components = array('RequestHandler');
> 
> public function index() {  
> $people = $this->Person->find('all');
> $this->set(array(
> 'people' => $people,
> '_serialize' => array('person')
> ));
> }
> }
> 
> and finally, in routes.php, I've mapped the proper roote:
> 
>  Router::mapResources('people');
> Router::parseExtensions('json');
> Router::connect('/', array('controller' => 'pages', 'action' => 
> 'display', 'home'));
> Router::connect('/pages/*', array('controller' => 'pages', 'action' => 
> 'display'));
> CakePlugin::routes();
> require CAKE . 'Config' . DS . 'routes.php';
> 
> but when I try to reach ht_tp://localhost/cakephp/people.json I get:
> 
>  onclick="document.getElementById('cakeErr501541d86308c-trace').style.display 
> = (document.getElementById('cakeErr501541d86308c-trace').style.display == 
> 'none' ? '' : 'none');">Notice (8): Undefined index: person 
> [CORE\Cake\View\JsonView.php, line 89] id="cakeErr501541d86308c-trace" class="cake-stack-trace" style="display: 
> none;"> onclick="document.getElementById('cakeErr501541d86308c-code').style.display = 
> (document.getElementById('cakeErr501541d86308c-code').style.display == 'none' 
> ? '' : 'none')">Code  onclick="document.getElementById('cakeErr501541d86308c-context').style.display
>  = (document.getElementById('cakeErr501541d86308c-context').style.display == 
> 'none' ? '' : 'none')">Context class="cake-code-dump" style="display: none;">$this->autoRender = false;
> $this->View = $View;
> $this->response->body($View->render($view, $layout));  id="cakeErr501541d86308c-context" class="cake-context" style="display: 
> none;">$view = null
> $layout = null
> $serialize = array(
>   (int) 0 => 'person'
> )
> $data = array()
> $key = 'person' class="stack-trace">JsonView::render() - CORE\Cake\View\JsonView.php, line 89
> Controller::render() - CORE\Cake\Controller\Controller.php, line 957
> Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 193
> Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 161
> [main] - APP\webroot\index.php, line 92{"person":null}
> 
> Where is the error?
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


[2.1] Problem with webservices

2012-07-29 Thread Mariano C.
I'm try to develop a simple webservices in CakePHP 2.1. So, i first created 
a DB table:

CREATE TABLE IF NOT EXISTS `people` (
>   `id` char(36) COLLATE utf8_bin NOT NULL,
>   `first_name` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `last_name` varchar(100) COLLATE utf8_bin NOT NULL,
>   `home_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `job_address` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `phone` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>   `fax` varchar(20) COLLATE utf8_bin DEFAULT NULL,
>   `mail` varchar(100) COLLATE utf8_bin DEFAULT NULL,
>   `birth_date` int(11) DEFAULT NULL
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin 


Than I've created a simple Person model:

 class Person extends AppModel {
> public $name = 'Person';
> }


And respective controller:

 class PeopleController extends AppController {
> public $components = array('RequestHandler');
> 
> public function index() {  
> $people = $this->Person->find('all');
> $this->set(array(
> 'people' => $people,
> '_serialize' => array('person')
> ));
> }
> }


and finally, in routes.php, I've mapped the proper roote:

 Router::mapResources('people');
> Router::parseExtensions('json');
> Router::connect('/', array('controller' => 'pages', 'action' => 
> 'display', 'home'));
> Router::connect('/pages/*', array('controller' => 'pages', 'action' => 
> 'display'));
> CakePlugin::routes();
> require CAKE . 'Config' . DS . 'routes.php';


but when I try to reach ht_tp://localhost/cakephp/people.json I get:

 onclick="document.getElementById('cakeErr501541d86308c-trace').style.display 
> = (document.getElementById('cakeErr501541d86308c-trace').style.display == 
> 'none' ? '' : 'none');">Notice (8): Undefined index: person 
> [CORE\Cake\View\JsonView.php, line 89] id="cakeErr501541d86308c-trace" class="cake-stack-trace" style="display: 
> none;"> onclick="document.getElementById('cakeErr501541d86308c-code').style.display 
> = (document.getElementById('cakeErr501541d86308c-code').style.display == 
> 'none' ? '' : 'none')">Code  onclick="document.getElementById('cakeErr501541d86308c-context').style.display
>  
> = (document.getElementById('cakeErr501541d86308c-context').style.display == 
> 'none' ? '' : 'none')">Context class="cake-code-dump" style="display: none;">$this->autoRender = false;
> $this->View = $View;
> $this->response->body($View->render($view, $layout));  
> id="cakeErr501541d86308c-context" class="cake-context" style="display: 
> none;">$view = null
> $layout = null
> $serialize = array(
> (int) 0 => 'person'
> )
> $data = array()
> $key = 'person' class="stack-trace">JsonView::render() - CORE\Cake\View\JsonView.php, line 
> 89
> Controller::render() - CORE\Cake\Controller\Controller.php, line 957
> Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 193
> Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 161
> [main] - APP\webroot\index.php, line 
> 92{"person":null}


Where is the error?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Numbers cutting off after comma

2012-07-29 Thread euromark
http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html 


Am Sonntag, 29. Juli 2012 04:17:24 UTC+2 schrieb Steven Scaffidi:
>
> Ok nevermind I changed the fields to INT and now they work fine. One more 
> question is there a way to change the defaults on the number helper. For 
> example, when I say 
>
> $this->Number->currency($price);
>
> Is there a way I can set the places to 0 by default instead of 2?
>
> On Saturday, July 28, 2012 8:53:57 PM UTC-5, Steven Scaffidi wrote:
>>
>> Hi,
>>
>> I have an form and one of the inputs is price. So if someone enters 1,500 
>> then for some reason it's cutting off the numbers after the comma. I looked 
>> at the print_r for $this->request->data and it shows the price as 1,500. 
>> Any ideas why it's cutting it off once it gets to the MySQL database. I 
>> have the field as a varchar. Should I make it an int?
>>
>> Steven
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cakephp Auth by get params

2012-07-29 Thread cosinusweb
Hi,

I'd like to authenticate my users by only a key string. 

like /blog/user/login/key => blog/user/login/DTR5656tfygs

I have a table users :
username
key
email
role


I' do it's not secure but It is the way it has to be done for my app. 
Client require it.

I don' t know how I can achieve that

Any ideas ?

I ve tried to extends BaseAuthenticate in components/auth with no success

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php