CakePHP Basics video tutorial

2012-08-13 Thread frederikjacques
Hi all,

I'm doing a CakePHP basics video tutorial series at 
http://blog.the-nerd.be/2012/08/cakephp-basics-tutorial-part-1/ . Currently 
part 1 is online about basic setup and reading from the database. Part 2 
will come online on Friday!
I wanted to add them to the screencast sections on the CakePHP website, but 
the video files are too heavy! So I hope you don't mind I put it here!

Happy baking!
Cheers,
Frederik

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Tutorial for REST API user create and authenticate?

2012-08-13 Thread 42startups
Simon! Yep it's me :)

I worked out I didn't include the RequestHandler component.

Second issue was formatting the POST data. Was trying to post raw json to
/users.json using a chrome plugin. Didn't work, but a simple form did so
long as the input name is in the format data[User][username]

Got to workout API authentication now. Any pointers?


On Mon, Aug 13, 2012 at 3:46 PM, Simon Males s...@sime.net.au wrote:

 Yo Nathan ? :)

 See first if you can make sense out of the below first. Shows your how
 to return Json/Xml views.

 http://book.cakephp.org/2.0/en/views/json-and-xml-views.html

 Handling a JSON POST request is the same as handling a HTTP POST.

 On Mon, Aug 13, 2012 at 3:11 PM, 42startups he...@42startups.com wrote:
  Hi
 
  I'm looking for an up-to-date tutorial on creating a REST API using Cake
 so
  that I can send a POST request to create a new User and also a GET
 request
  to fetch and authenticate a User's username and password.
 
  I've found a few online, but they seem to be from the 1.3 Cake version.
 And
  the Cookbook instructions don't seem to work for me.
 
  Cheers
 
  --
  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com.
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com.
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



 --
 Simon Males

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Tutorial for REST API user create and authenticate?

2012-08-13 Thread Simon Males
Yeah API/REST Auth is a little tricky.

At the moment I'm checking the extension of the request (.json) in
AppController::beforeFilter(), then switching the Auth type to Basic
and then attempting $this-Auth-login().

When it's basic, the user/pass comes in via
http://user:p...@example.com/ and authenticated on every request.

Other guys from the team generate a token, and in the beforeFilter()
see if that token matches up a user record. If so manually login the
user.

Lastly, when I get a bit of time I'm going to look at this:
https://github.com/nodesagency/Platform-API-plugin

Hope that helps dude.

On Mon, Aug 13, 2012 at 4:40 PM, 42startups he...@42startups.com wrote:
 Simon! Yep it's me :)

 I worked out I didn't include the RequestHandler component.

 Second issue was formatting the POST data. Was trying to post raw json to
 /users.json using a chrome plugin. Didn't work, but a simple form did so
 long as the input name is in the format data[User][username]

 Got to workout API authentication now. Any pointers?


 On Mon, Aug 13, 2012 at 3:46 PM, Simon Males s...@sime.net.au wrote:

 Yo Nathan ? :)

 See first if you can make sense out of the below first. Shows your how
 to return Json/Xml views.

 http://book.cakephp.org/2.0/en/views/json-and-xml-views.html

 Handling a JSON POST request is the same as handling a HTTP POST.

 On Mon, Aug 13, 2012 at 3:11 PM, 42startups he...@42startups.com wrote:
  Hi
 
  I'm looking for an up-to-date tutorial on creating a REST API using Cake
  so
  that I can send a POST request to create a new User and also a GET
  request
  to fetch and authenticate a User's username and password.
 
  I've found a few online, but they seem to be from the 1.3 Cake version.
  And
  the Cookbook instructions don't seem to work for me.
 
  Cheers
 
  --
  You received this message because you are subscribed to the Google
  Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com.
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com.
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



 --
 Simon Males

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.



 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.





-- 
Simon Males

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePdf - How To Start?

2012-08-13 Thread Bharat Maheshwari
Hi,

You can use the below link to create a pdf in cakephp.It is easy to 
implement.
http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf

On Thursday, August 9, 2012 6:33:49 PM UTC+5:30, DerekGardiner wrote:

 I seem to be following in elogic's foot steps and battling with the same 
 issues. Does anyone know of a better tutorial to use than the readme file 
 on GITHUB? Desperately trying to get this plugin to produce a PDF.

 On Friday, 3 August 2012 07:03:11 UTC+2, elogic wrote:

 I have just downloaded and installed CakePdf - 
 https://github.com/ceeram/CakePdf

 I don't understand how to get a sample PDF running. Anything will do, 
 i.e. hello world, once I get this going then I can look into generating 
 things further.

 Thanks.



-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Braindead
Have a look at Opauth. It's a nice plugin working really well.

https://github.com/uzyn/cakephp-opauth 

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: cakePHP 2.0 read rss feed

2012-08-13 Thread majna
Try this, and read 
http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html

?php
App::uses('Xml', 'Utility');

class FeedsController extends AppController {
   
 
var $feed_url = http://kurinchilamp.kurinchilion.com/feed;;
var $rss_item = array();


function read() {
$parsed_xml = Xml::build($this-feed_url);
// xml to array conversion
$this-rss_item = Xml::toArray($parsed_xml);
$this-set('data', $this-rss_item['Rss']['Channel']['Item']);
}

}


On Sunday, August 12, 2012 1:02:23 PM UTC+2, suttipong Pratum wrote:


i try  to read  rss feed from   
 http://kurinchilamp.kurinchilion.com/2009/06/cakephp-parsing-rss-feed-in-simple-steps.html

 then  error 

 *Error: * Class 'XML' not found 
 *File: * /home/pos/cakeProject/XXX/app/Controller/FeedsController.php 
 *Line: * 11

 XMl  not found 


 this my  controller 

 ?php
 class FeedsController extends AppController {

  
 var $feed_url = http://kurinchilamp.kurinchilion.com/feed;;
 var $rss_item = array();
 
 
 function read() {
  App::import('Xml');
 $parsed_xml = new XML($this-feed_url);
 // xml to array conversion
 $this-rss_item = $parsed_xml-toArray();
 $this-set('data', $this-rss_item['Rss']['Channel']['Item']);
 }
 }


 tell to fix  this  error  .


 thanl you 


-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Sanjeev Divekar
I think HybridAuth is better in response data provided.
Any other suggestion?

On Mon, Aug 13, 2012 at 2:21 PM, Braindead markus.he...@gmail.com wrote:

 Have a look at Opauth. It's a nice plugin working really well.

 https://github.com/uzyn/cakephp-opauth

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Warm Regards,
Sanjeev
http://sanjeevdivekar.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Whats wrong?

2012-08-13 Thread Tilen Majerle
$this-Weeklyroster-id = $week;

you must replace 'week' with 'id' :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/8/13 mohit kumar mohitk...@gmail.com

 $this-Weeklyroster-week = $week;

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Error: The requested address was not found on this server.

2012-08-13 Thread Luís de Sousa
Please.

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Braindead


 I think HybridAuth is better in response data provided.


The only difference I can see is that HybridAuth does automatically login 
using AuthComponent and Opauth does not. But actually this can be done in a 
few lines of code. Opauth has the advantage that it is a nice plugin that 
fits nicely into any Cake app.

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Sanjeev Divekar
HybridAuth gives more profile data then Opauth. I could't find user's email
from demo in Opauth.

On Mon, Aug 13, 2012 at 6:00 PM, Braindead markus.he...@gmail.com wrote:

 I think HybridAuth is better in response data provided.


 The only difference I can see is that HybridAuth does automatically login
 using AuthComponent and Opauth does not. But actually this can be done in a
 few lines of code. Opauth has the advantage that it is a nice plugin that
 fits nicely into any Cake app.

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Warm Regards,
Sanjeev
http://sanjeevdivekar.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Chetan Varshney
Hi Sanjeev,

Please have a look on http://umpremium.ektasoftwares.com for authenticating
users and other features.

On Mon, Aug 13, 2012 at 6:03 PM, Sanjeev Divekar
sanjeevdive...@gmail.comwrote:

 HybridAuth gives more profile data then Opauth. I could't find user's
 email from demo in Opauth.

 On Mon, Aug 13, 2012 at 6:00 PM, Braindead markus.he...@gmail.com wrote:

 I think HybridAuth is better in response data provided.


 The only difference I can see is that HybridAuth does automatically login
 using AuthComponent and Opauth does not. But actually this can be done in a
 few lines of code. Opauth has the advantage that it is a nice plugin that
 fits nicely into any Cake app.

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






 --
 Warm Regards,
 Sanjeev
 http://sanjeevdivekar.wordpress.com

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Thanks  Regards

Chetan Varshney
Director of Ekta Softwares
Noida India
Website- EktaSoftwares.Com http://www.ektasoftwares.com
Email- chetanvarsh...@gmail.com
Skype- chetan-varshney
Mob no- +919891538749

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Social Networking Login with Auth Component.

2012-08-13 Thread Sanjeev Divekar
I will stick to CakePHP's basic Auth component.

On Mon, Aug 13, 2012 at 6:05 PM, Chetan Varshney
chetanvarsh...@gmail.comwrote:

 Hi Sanjeev,

 Please have a look on http://umpremium.ektasoftwares.com for
 authenticating users and other features.


 On Mon, Aug 13, 2012 at 6:03 PM, Sanjeev Divekar sanjeevdive...@gmail.com
  wrote:

 HybridAuth gives more profile data then Opauth. I could't find user's
 email from demo in Opauth.

 On Mon, Aug 13, 2012 at 6:00 PM, Braindead markus.he...@gmail.comwrote:

 I think HybridAuth is better in response data provided.


 The only difference I can see is that HybridAuth does automatically
 login using AuthComponent and Opauth does not. But actually this can be
 done in a few lines of code. Opauth has the advantage that it is a nice
 plugin that fits nicely into any Cake app.

 --
 You received this message because you are subscribed to the Google
 Groups CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






 --
 Warm Regards,
 Sanjeev
 http://sanjeevdivekar.wordpress.com

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






 --
 Thanks  Regards

 Chetan Varshney
 Director of Ekta Softwares
 Noida India
 Website- EktaSoftwares.Com http://www.ektasoftwares.com
 Email- chetanvarsh...@gmail.com
 Skype- chetan-varshney
 Mob no- +919891538749


  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Warm Regards,
Sanjeev
http://sanjeevdivekar.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Error to save in database

2012-08-13 Thread Lucas Simon Rodrigues Magalhaes
I have a model User.php in plugin, look my gist[1] 

[1] https://gist.github.com/3340251 


Em sexta-feira, 10 de agosto de 2012 20h25min57s UTC-3, cricket escreveu:

 It's happening because Cake cannot find your User model. When you do 
 $this-User-something() it is usingthe AppModel instead of User 
 model. And so registerValidate is being sent directly to the 
 database as a query. 

 Is this model in a plugin? What is the file name? What does the first 
 line have? eg. 

 class User extends Appmodel { 

 On Fri, Aug 10, 2012 at 4:29 PM, Lucas Simon Rodrigues Magalhaes 
 luca...@gmail.com javascript: wrote: 
  hii guys!!! 
  
  I have a error[1] in any save data of my actions in my UserController. 
  The error is in my function to validate[2] a add[3] user 
  
  [1]  http://pastebin.com/M3hSWD9k 
  [2]  http://pastebin.com/9Wg1Aujm 
  [3]  http://pastebin.com/rZctnxFX 
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
  cake-php+u...@googlegroups.com javascript:. 
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US. 
  
  


-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




datasource Call to undefined method

2012-08-13 Thread mr. mohrd
Hi!
I've created a simple `datasource`:

// app/Model/Datasource/FeedSource.php

App::uses('DataSource', 'Model/Datasource');

class FeedSource extends DataSource {
public function abcd() {
echo 'Hello World!';
}
}

in my 'database.php':

public $feed = array(
'datasource' = 'FeedSource'
);

And in `Feeda` model:

App::uses('AppModel', 'Model');

class Feeda extends AppModel {
public $useTable = false;
public $useDbConfig = 'feed';
}

in 'list' controller:

$this-loadModel('Feeda');
$this-Feeda-abcd();

But, it returns a fatal error:

Error: Call to undefined method FeedSource::query()

How to resolve it?

Thanks...

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Tutorial for REST API user create and authenticate?

2012-08-13 Thread Robert Love
Nathan. Is that you? :)

Have you tried this http://book.cakephp.org/2.0/en/development/rest.html

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: send mails

2012-08-13 Thread raj kumar Pustela
hi to all,
  how to login with username or emil in cake php 2.0.3 

  if any one known about that pls help me.



*thanks,*
*rajkumar*




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: send mails

2012-08-13 Thread Chetan Varshney
Hi Raj,

Please have a look on http://umpremium.ektasoftwares.com for login with
email and username.

Also you will get lots of features

On Mon, Aug 13, 2012 at 12:08 PM, raj kumar Pustela pustela...@gmail.comwrote:

 hi to all,
   how to login with username or emil in cake php 2.0.3

   if any one known about that pls help me.



 *thanks,*
 *rajkumar*




  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Thanks  Regards

Chetan Varshney
Director of Ekta Softwares
Noida India
Website- EktaSoftwares.Com http://www.ektasoftwares.com
Email- chetanvarsh...@gmail.com
Skype- chetan-varshney
Mob no- +919891538749

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Stupid question

2012-08-13 Thread scs
Your redirect is happening even if you are logged int. try this adjustment:
 public function login() {
   if($this-request-is('post')) {
  if($this-Auth-login()) {
//User is authorized so see if they have an owner 
//record   
   $results = 
$this-User-findById($this-Auth-user('id'));
   $this-set('results',$results);
  }else{
   $this-redirect($this-Auth-redirect());
  }
} else {
$this-Session-setFlash(_('Invalid name or password,try 
again'));
}
  }


On Sunday, August 12, 2012 7:40:45 PM UTC-4, Toren Valone wrote:

 I know this is probably a simple answer, but i appear to be stumped, I 
 have a user controller, which authorizes a user and then checks to see if 
 they user has an owner record. Unfortuanltly my code just flies over the 
 code and hits the redirect in the appcontroller. Here is the 
 UserController.php code.  

  public function login() {
   if($this-request-is('post')) {
  if($this-Auth-login()) {
  //User is authorized so see if they have an owner 
  //record   
  $results = $this-User-findById($this-Auth-user('id'));
  $this-set('results',$results);

  }
 $this-redirect($this-Auth-redirect());
  } else {
 $this-Session-setFlash(_('Invalid name or password,try 
 again'));
  }
   }

 here is the view in Users/is_owner.ctp

 ? echo debug($results); ?
 ? echo debug($results['User']); ?




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




rendering view from a different controller

2012-08-13 Thread Jim Bracewell
I am having a problem trying to call render on views from two seperate 
controllers and retrieve the html automatically to the original function. 
I tried $this-render , but this fails because the views contain GET 
parameters. Is there any way to render a view from a different controller 
when GET parameters are needed?
thanks.

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Error to save in database

2012-08-13 Thread Lucas Simon Rodrigues Magalhaes
I don't understand it. I define the correct names of Model Files and the 
cake don't recognize the model User? How?


Em segunda-feira, 13 de agosto de 2012 09h41min39s UTC-3, Lucas Simon 
Rodrigues Magalhaes escreveu:

 I have a model User.php in plugin, look my gist[1] 

 [1] https://gist.github.com/3340251 


 Em sexta-feira, 10 de agosto de 2012 20h25min57s UTC-3, cricket escreveu:

 It's happening because Cake cannot find your User model. When you do 
 $this-User-something() it is usingthe AppModel instead of User 
 model. And so registerValidate is being sent directly to the 
 database as a query. 

 Is this model in a plugin? What is the file name? What does the first 
 line have? eg. 

 class User extends Appmodel { 

 On Fri, Aug 10, 2012 at 4:29 PM, Lucas Simon Rodrigues Magalhaes 
 luca...@gmail.com wrote: 
  hii guys!!! 
  
  I have a error[1] in any save data of my actions in my UserController. 
  The error is in my function to validate[2] a add[3] user 
  
  [1]  http://pastebin.com/M3hSWD9k 
  [2]  http://pastebin.com/9Wg1Aujm 
  [3]  http://pastebin.com/rZctnxFX 
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To post to this group, send email to cake...@googlegroups.com. 
  To unsubscribe from this group, send email to 
  cake-php+u...@googlegroups.com. 
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US. 
  
  



-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Error to save in database

2012-08-13 Thread rchavik


On Monday, August 13, 2012 8:54:04 PM UTC+7, Lucas Simon Rodrigues 
Magalhaes wrote:

 I don't understand it. I define the correct names of Model Files and the 
 cake don't recognize the model User? How?


you might need to tell AuthComponent which userModel to use.

Typically, you'll tell Auth by:

$components = array(
   'Auth' = array(
 'authorize' = array(
   'userModel' = 'Plugin.User',
)));
 



 Em segunda-feira, 13 de agosto de 2012 09h41min39s UTC-3, Lucas Simon 
 Rodrigues Magalhaes escreveu:

 I have a model User.php in plugin, look my gist[1] 

 [1] https://gist.github.com/3340251 


 Em sexta-feira, 10 de agosto de 2012 20h25min57s UTC-3, cricket escreveu:

 It's happening because Cake cannot find your User model. When you do 
 $this-User-something() it is usingthe AppModel instead of User 
 model. And so registerValidate is being sent directly to the 
 database as a query. 

 Is this model in a plugin? What is the file name? What does the first 
 line have? eg. 

 class User extends Appmodel { 

 On Fri, Aug 10, 2012 at 4:29 PM, Lucas Simon Rodrigues Magalhaes 
 luca...@gmail.com wrote: 
  hii guys!!! 
  
  I have a error[1] in any save data of my actions in my UserController. 
  The error is in my function to validate[2] a add[3] user 
  
  [1]  http://pastebin.com/M3hSWD9k 
  [2]  http://pastebin.com/9Wg1Aujm 
  [3]  http://pastebin.com/rZctnxFX 
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To post to this group, send email to cake...@googlegroups.com. 
  To unsubscribe from this group, send email to 
  cake-php+u...@googlegroups.com. 
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US. 
  
  



-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Error to save in database

2012-08-13 Thread Lucas Simon Rodrigues Magalhaes
Does not work... cake genarete a message error:
Authorization adapter quot;userModelquot; was not found.

Error: An Internal Error Has Occurred.

I add AppController.php in this gist[1].



[1]  https://gist.github.com/3340251 

Em segunda-feira, 13 de agosto de 2012 11h06min30s UTC-3, rchavik escreveu:



 On Monday, August 13, 2012 8:54:04 PM UTC+7, Lucas Simon Rodrigues 
 Magalhaes wrote:

 I don't understand it. I define the correct names of Model Files and the 
 cake don't recognize the model User? How?


 you might need to tell AuthComponent which userModel to use.

 Typically, you'll tell Auth by:

 $components = array(
'Auth' = array(
  'authorize' = array(
'userModel' = 'Plugin.User',
 )));
  



 Em segunda-feira, 13 de agosto de 2012 09h41min39s UTC-3, Lucas Simon 
 Rodrigues Magalhaes escreveu:

 I have a model User.php in plugin, look my gist[1] 

 [1] https://gist.github.com/3340251 


 Em sexta-feira, 10 de agosto de 2012 20h25min57s UTC-3, cricket escreveu:

 It's happening because Cake cannot find your User model. When you do 
 $this-User-something() it is usingthe AppModel instead of User 
 model. And so registerValidate is being sent directly to the 
 database as a query. 

 Is this model in a plugin? What is the file name? What does the first 
 line have? eg. 

 class User extends Appmodel { 

 On Fri, Aug 10, 2012 at 4:29 PM, Lucas Simon Rodrigues Magalhaes 
 luca...@gmail.com wrote: 
  hii guys!!! 
  
  I have a error[1] in any save data of my actions in my 
 UserController. 
  The error is in my function to validate[2] a add[3] user 
  
  [1]  http://pastebin.com/M3hSWD9k 
  [2]  http://pastebin.com/9Wg1Aujm 
  [3]  http://pastebin.com/rZctnxFX 
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To post to this group, send email to cake...@googlegroups.com. 
  To unsubscribe from this group, send email to 
  cake-php+u...@googlegroups.com. 
  Visit this group at http://groups.google.com/group/cake-php?hl=en-US. 

  
  



-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: rendering view from a different controller

2012-08-13 Thread Tilen Majerle
can you please describe your problem more ? :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/8/13 Jim Bracewell jmsbrc...@gmail.com

 I am having a problem trying to call render on views from two seperate
 controllers and retrieve the html automatically to the original function.
 I tried $this-render , but this fails because the views contain GET
 parameters. Is there any way to render a view from a different controller
 when GET parameters are needed?
 thanks.

 --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: rendering view from a different controller

2012-08-13 Thread Jim Bracewell
My aim is to retrieve the html of a view without user interaction 
(basically just call a function that returns the html that is generated for 
a specific view). My problem is that this doesn't appear to be possible 
when both of the following are true:
1. the view is in a different controller to the one which requires the html
2. there are get parameters required to render the view correctly.

thanks again, I would appreciate if anybody knows a solution to this.

On Monday, 13 August 2012 15:31:46 UTC+1, MaJerle.Eu wrote:

 can you please describe your problem more ? :)
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2012/8/13 Jim Bracewell jmsb...@gmail.com javascript:

 I am having a problem trying to call render on views from two seperate 
 controllers and retrieve the html automatically to the original function. 
 I tried $this-render , but this fails because the views contain GET 
 parameters. Is there any way to render a view from a different controller 
 when GET parameters are needed?
 thanks.

 -- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 To unsubscribe from this group, send email to 
 cake-php+u...@googlegroups.com javascript:.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
  
  




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: rendering view from a different controller

2012-08-13 Thread Tilen Majerle
i think that is not possible...try with elements
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/8/13 Jim Bracewell jmsbrc...@gmail.com

 My aim is to retrieve the html of a view without user interaction
 (basically just call a function that returns the html that is generated for
 a specific view). My problem is that this doesn't appear to be possible
 when both of the following are true:
 1. the view is in a different controller to the one which requires the html
 2. there are get parameters required to render the view correctly.

 thanks again, I would appreciate if anybody knows a solution to this.


 On Monday, 13 August 2012 15:31:46 UTC+1, MaJerle.Eu wrote:

 can you please describe your problem more ? :)
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2012/8/13 Jim Bracewell jmsb...@gmail.com

  I am having a problem trying to call render on views from two seperate
 controllers and retrieve the html automatically to the original function.
 I tried $this-render , but this fails because the views contain GET
 parameters. Is there any way to render a view from a different controller
 when GET parameters are needed?
 thanks.

 --
 You received this message because you are subscribed to the Google
 Groups CakePHP group.
 To post to this group, send email to cake...@googlegroups.com.
 To unsubscribe from this group, send email to cake-php+u...@**
 googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/cake-php?hl=en-UShttp://groups.google.com/group/cake-php?hl=en-US
 .




  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




undefined index error

2012-08-13 Thread mohit kumar
Hi Folks,

I am having a strange error. I don't know what I am doing wrong.
I am using following code in my weeklyrostercontroller.php file

var $uses = array('Weeklyroster','Shift');


I have created a function to generate the roster.


public function generate($id = null) {
 $this-Weeklyroster-week= $id;
 //if (!$this-Weeklyroster-exists()) {
 //throw new NotFoundException(__('Invalid weeklyroster'));
 //}
 //$this-set('weeklyroster', $this-Weeklyroster-read('week',
 $id));
 $current_roster = $this-Weeklyroster-find('all',
 array('conditions' = array('Weeklyroster.week' = $id)));
 foreach ($current_roster as $current_rosters) {
 $vid=$current_rosters['Weeklyroster']['id'];

 $current_shifts =
 $this-Weeklyroster-Shift-find('all',array('conditions' =
 array('Shift.id' = $vid)));


 }


 $this-set('weeklyroster', $current_roster);
 $this-set('current_shifts',$current_shifts);

 }
 }


  if a use following code ($weeklyroster['Weeklyroster']['week'] in my view
file , I get the following error.

*Notice* (8): Undefined index: Weeklyroster
[*APP\View\Weeklyrosters\generate.ctp*, line *3*]

Please suggest



*With Best Regards,
Mohit Kumar http://kumarmohit.com*
*+91-9582894570*

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Users who try to sell plugins/support on the list

2012-08-13 Thread Thiago Belem
Hey guys,

Try to sell plugins - on the list - is not against the rules?

If the user does not answer further questions, and only responds when it
can pass the link to his plugin (paid), this does not show bad faith?

What can we do about this? I remember that few days ago some of these users
were removed from the list, but I think they're here again.

Regads

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Why doesn't JsonView trigger callbacks?

2012-08-13 Thread Lucho Molina
I was playing around with JsonView and the PaginatorHelper and noticed that 
the data returned by $this-Paginator-next() was different to the one 
returned by the same method when using the normal (HTML) view. 

Digging into the code, I found out that the JsonView doesn't trigger the 
beforeRender callback. Why is that? is this a bug or is it meant to be like 
that by design?

Specifically speaking, the render method of the View class triggers the 
callbacks like this:

*464 *$this-getEventManager()-dispatch(new CakeEvent('View.beforeRender', 
$this, array($viewFileName)));
*465 *$this-Blocks-set('content', $this-_render($viewFileName));
*466 *$this-getEventManager()-dispatch(new CakeEvent('View.afterRender', 
$this, array($viewFileName)));
Whereas JsonView-render() will just return the $content without triggering 
the callbacks. 

I'm on version 2.1.3, btw.

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: cakePHP 2.0 read rss feed

2012-08-13 Thread soda sonic
thank you majna  i new bebi cakephp

before put App::uses('Xml', 'Utility'); in  controller class  now i see you
exam  and try it
it's easy

thank you very much

2012/8/13 majna majna...@gmail.com

 Try this, and read
 http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html

 ?php
 App::uses('Xml', 'Utility');


 class FeedsController extends AppController {


 var $feed_url = 
 http://kurinchilamp.**kurinchilion.com/feedhttp://kurinchilamp.kurinchilion.com/feed
 ;
 var $rss_item = array();


 function read() {
 $parsed_xml = Xml::build($this-feed_url);

 // xml to array conversion
 $this-rss_item = Xml::toArray($parsed_xml);

 $this-set('data', $this-rss_item['Rss']['Channel']['Item']);
 }

 }


 On Sunday, August 12, 2012 1:02:23 PM UTC+2, suttipong Pratum wrote:


i try  to read  rss feed from   http://kurinchilamp.**
 kurinchilion.com/2009/06/**cakephp-parsing-rss-feed-in-**
 simple-steps.htmlhttp://kurinchilamp.kurinchilion.com/2009/06/cakephp-parsing-rss-feed-in-simple-steps.html
 then  error

 *Error: * Class 'XML' not found
 *File: * /home/pos/cakeProject/XXX/app/**Controller/FeedsController.php
 *Line: * 11

 XMl  not found


 this my  controller

 ?php
 class FeedsController extends AppController {


 var $feed_url = 
 http://kurinchilamp.**kurinchilion.com/feedhttp://kurinchilamp.kurinchilion.com/feed
 ;
 var $rss_item = array();


 function read() {
  App::import('Xml');
 $parsed_xml = new XML($this-feed_url);
 // xml to array conversion
 $this-rss_item = $parsed_xml-toArray();
 $this-set('data', $this-rss_item['Rss']['**Channel']['Item']);
 }
 }


 tell to fix  this  error  .


 thanl you

  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.






-- 
Sincerely

Noom .  086 688 5686

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePdf - How To Start?

2012-08-13 Thread elogic
Thanks however Ideally I really want to get CakePdf going rather then using 
another process.

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePdf - How To Start?

2012-08-13 Thread Ceeram
Hi guys, im the maintainer of the plugin. Lets nail this, so i know what to 
add to the docs.


For what i know everything is in the readme, but perhaps i missed a step.


You can use CakePdf in 2 ways:

1. Render like normal html view in the browser but as pdf (or forced 
download), use the same url and add .pdf extension. You can use the same 
controller action, view() in this example, just use other view.ctp (in pdf 
subdir) and layout. If you decide for whatever reason to create a separate 
pdf_view() action, you should also browse to corresponding url: 
users/pdf_view/1.pdf and create the pdf_view.ctp in the pdf subdir.

2. Or use directly by creating CakePdf instance to get the pdf string 
returned to attach to an email for instance.

Seems you just didnt add the .pdf url extension, also the engine value 
should exactly match the classname of the engine without Engine suffix, so 
for tcpdf that should be: 'engine' = 'Tcpdf'
The 'prefix' is not a config option btw.

I know people using this plugin in production sites, and the plugin has 
plenty of tests, if i missed something id be more then happy to add 
to/update the readme and/or tests. Its just not clear to me what is 
missing/incorrect in the readme.

From
On Monday, August 13, 2012 11:40:47 PM UTC+2, elogic wrote:

 Thanks however Ideally I really want to get CakePdf going rather then 
 using another process.



-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Class 'CakePlugin' not found while using google Oauth plugin

2012-08-13 Thread Harshit Sharma
I was following tutorial but came across this fatal error :

class cakeplugin is present in /var/www/cakephp/lib/Cake/Core 

I am trying to use google oauth plugin for cakephp app , after following 
steps as given on :

https://github.com/uzyn/opauth-google/blob/master/README.md

But when I run my app I get above mentioned fatal error,

Do I need to change the links or copy the plugin file ? Or something wrong 
is ther ein my approach?

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Date picker for CakePHP 2.0.3

2012-08-13 Thread Paolo
HELP! It worked fine with your step-by-step instructions, Florin. However, 
I'm building a search form where I need 2 different datepickers, but it's 
not working. 

I guess the problem is that two DOM elements can't have the same value in 
their ID attribute (which in this case is datepicker)

any workarounds? Thanks in advance

El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió:

 Thank you very much! Indeed it worked.

 Just to let the other users know in case they will have the same problem:

 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put 
 the file in $project/app/webroot/js (e.q: *
 $project/app/webroot/js/jquery.js*)
 2. Download jquery-ui (http://jqueryui.com/download); I, for example, 
 downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this 
 archive you will have to copy the followings:

 a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give 
 it a shorter name e.q: jquery-ui.js)
 b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including 
 the images; rename the css file to something shorter)

 3. Include both js files in your layout. eq:
 *
 //$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-script(array('jquery',
 'jquery-ui'));

 *4. Include the css file. Eq

 *//$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-css('jquery-ui.css');

 *5. Put this lines of code before calling the date-picker:

 *script
 $(function() {
$(#datepicker).datepicker();
 });
 /script*

 6. Call the date picker in your form:

 *echo $this-Form-input('expire', 
 array(
'id'='datepicker',
'type'='text'
 )*

 This is it!

 Best regards!




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Date picker for CakePHP 2.0.3

2012-08-13 Thread Paolo
Nevermind! solved it, it's working now. 

I changed 

*array('id'='datepicker', 'type'='text')*

to

*array('class'='datepicker', 'type'='text')*


and then changed


script
$(function() {
   $(#datepicker).datepicker();
});
/script

to 

*script*
*$(function() {*
*   $(.datepicker).datepicker();*
*});*
*/script*


this way, jQuery uses the class, not the ID, to find the fields where 
datepicker must be applied.

Regards!

El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió:

 Thank you very much! Indeed it worked.

 Just to let the other users know in case they will have the same problem:

 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put 
 the file in $project/app/webroot/js (e.q: *
 $project/app/webroot/js/jquery.js*)
 2. Download jquery-ui (http://jqueryui.com/download); I, for example, 
 downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this 
 archive you will have to copy the followings:

 a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give 
 it a shorter name e.q: jquery-ui.js)
 b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including 
 the images; rename the css file to something shorter)

 3. Include both js files in your layout. eq:
 *
 //$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-script(array('jquery',
 'jquery-ui'));

 *4. Include the css file. Eq

 *//$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-css('jquery-ui.css');

 *5. Put this lines of code before calling the date-picker:

 *script
 $(function() {
$(#datepicker).datepicker();
 });
 /script*

 6. Call the date picker in your form:

 *echo $this-Form-input('expire', 
 array(
'id'='datepicker',
'type'='text'
 )*

 This is it!

 Best regards!




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Date picker for CakePHP 2.0.3

2012-08-13 Thread Thiago Belem
Use a class, not an ID...
Em 13/08/2012 21:04, Paolo pmoscate...@gmail.com escreveu:

 HELP! It worked fine with your step-by-step instructions, Florin. However,
 I'm building a search form where I need 2 different datepickers, but it's
 not working.

 I guess the problem is that two DOM elements can't have the same value in
 their ID attribute (which in this case is datepicker)

 any workarounds? Thanks in advance

 El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió:

 Thank you very much! Indeed it worked.

 Just to let the other users know in case they will have the same problem:

 1. Download jquery 
 (http://docs.jquery.com/**Downloading_jQueryhttp://docs.jquery.com/Downloading_jQuery)
 and put the file in $project/app/webroot/js (e.q: *
 $project/app/webroot/js/jquery.js*)
 2. Download jquery-ui (http://jqueryui.com/download)**; I, for example,
 downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this
 archive you will have to copy the followings:

 a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give
 it a shorter name e.q: jquery-ui.js)
 b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including 
 the images; rename the css file to something shorter)

 3. Include both js files in your layout. eq:
 *
 //$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-script(array('jquery',
 'jquery-ui'));

 *4. Include the css file. Eq

 *//$project/app/views/Layouts/default.ctp
 -
 echo $this-Html-css('jquery-ui.css');

 *5. Put this lines of code before calling the date-picker:

 *script
 $(function() {
$(#datepicker).datepicker();
 });
 /script*

 6. Call the date picker in your form:

 *echo $this-Form-input('expire',
 array(
'id'='datepicker',
'type'='text'
 )*

 This is it!

 Best regards!


  --
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com.
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.