Re: Redirect to static page not working

2012-01-08 Thread Thiago Belem
You need allow the "display" action

--
Thiago Belem,
Desenvolvedor WEB

Enviado do meu Android
Em 09/01/2012 04:29, "Jeremy Burns | Class Outfit" <
jeremybu...@classoutfit.com> escreveu:

> From what you have written it appears that your Auth->allow statement
> doesn't include /pages/email_sent - so it will prompt for a log in.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 8 Jan 2012, at 16:38:43, Daniel wrote:
>
> I am trying to redirect to a static page from a controller (users add)
> using:
> $this->redirect('/pages/email_sent');
>
> ... but I get sent to the users login view.  The same happens if I try
> to type the url into the browser:
> localhost/myapp/pages/email_sent
>
> Note I have the auth component set up as follows:
> $this->Auth->allow('index', 'view');
> $this->Auth->loginRedirect = array('controller'=>'posts', 'action' =>
> 'index');
> $this->Auth->logoutRedirect = array('controller'=>'posts', 'action' =>
> 'index');
>
> 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
>
>
>  --
> 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: Redirect to static page not working

2012-01-08 Thread Jeremy Burns | Class Outfit
>From what you have written it appears that your Auth->allow statement doesn't 
>include /pages/email_sent - so it will prompt for a log in.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 8 Jan 2012, at 16:38:43, Daniel wrote:

> I am trying to redirect to a static page from a controller (users add)
> using:
> $this->redirect('/pages/email_sent');
> 
> ... but I get sent to the users login view.  The same happens if I try
> to type the url into the browser:
> localhost/myapp/pages/email_sent
> 
> Note I have the auth component set up as follows:
> $this->Auth->allow('index', 'view');
> $this->Auth->loginRedirect = array('controller'=>'posts', 'action' =>
> 'index');
> $this->Auth->logoutRedirect = array('controller'=>'posts', 'action' =>
> 'index');
> 
> 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

-- 
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


Config\email.php isnt loaded

2012-01-08 Thread Arnold
Hi, im following the instructions on book.

I added this on bootstrap.php:

App::uses('CakeEmail', 'Network/Email');

i rename the email.php.default to email.php and setup a gmail
connection (Exactly as the book suggest).

I set it in $default.

Next i try to send a mail but im receiving this error:

Errors
Could not send email.
Error: An Internal Error Has Occurred.
Stack Trace
#0 C:\Users\Arnold\Documents\dev\tutor\trunk\lib\Cake\Network\Email
\CakeEmail.php(966): MailTransport->send(Object(CakeEmail))

It seems like if they wasnt load my transport config, so i try adding
die("TEST") on top of email.php but my script doesnt died, is like the
cake config is not included

this file is suppose to be automatically included? what includes it?
cause isnt working for me..

-- 
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: Starting with 1.13 or 2.0

2012-01-08 Thread José Lorenzo
2.0

-- 
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: Starting with 1.13 or 2.0

2012-01-08 Thread Miles J
Start with 2.0!

On Jan 8, 2:11 pm, Jerome Heuze - HEUZE Production
 wrote:
> Hello Everyone!
> Here is my new year resolution - start using CakePHP for my web apps
> projects...
>
> So for me to start should i be using/learning 1.x or 2.x version of
> CakePHP?
>
> You might want to know more about what i do - i am a front end
> developer so i do deal more about html/css/js but outside of my daily
> job i would like to be involve with both ends (backend and front end).
>
> Thank you all. And Happy New year!

-- 
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.1-alpha just baked

2012-01-08 Thread José Lorenzo


The CakePHP core team is proud to announce the immediate availability of 
CakePHP 2.1.0 alpha [1]. Version 2.1 is fully backwards compatible with 
2.0.x release. This means that if you have an app already working in 2.0 or 
plan to upgrade one to it, you can safely start using 2.1 right away and 
expect no additional work in upgrading. We are very excited about several 
enhancements that are part of 2.1 and are working hard to get the few 
remaining improvements completed.

In total, there were over 230 commits and over 15 new features or 
enhancements added to CakePHP 2.1. A complete list of the changes can be 
viewed in the changelogs page [2]. This is a quick list of this version's 
main highlights:
Content Type Views

Two new view classes have been added to CakePHP. The new JsonView and 
XmlView allow you to more easily generate XML and JSON views.

By enabling RequestHandlerComponent in your application, and enabling 
support for the xml and or jsonextensions, you can automatically leverage 
the new view classes. There are two ways you can generate data views. The 
first is by using the _serialize key, and the second is by creating normal 
view files.

This makes it super easy to create content-type specific pages and 
automatic error responses in the correct mime-types.
Extending views

The View class has a new method allowing you to wrap or 'extend' a 
view/element/layout with another file. This introduces the ideas of 
"sub-layouts" making your views more flexible than ever, this was 
implemented using ViewBlocks.

View blocks are a flexible way to create slots or blocks in your views. 
Blocks replace $scripts_for_layout and $content_for_layoutwith a more 
robust and flexible API.

For example blocks are ideal for implementing things such as sidebars, or 
regions to load assets at the bottom/top of the layout.
Plugin.view

All layout/view/element names can now use Plugin.view to indicate that a 
plugin view should be used. The plugin option forView::element() is 
deprecated.
Improved errors

The debug() function output is now cleaner and more readable. We have also 
added interactive stack traces to exception pages. You can click on each 
point of the trace to take a peek at the variable state for that point. 
Also, as mentioned earlier, CakePHP can now respond with content-type 
specific error pages.
General purpose event system

A new, generic event system has been built and it replaces the way 
callbacks are dispatched. This should not result in any changes to your 
code though. You can dispatch your own events and attach callbacks to them 
at will. This is useful for inter-plugin communication and decoupling of 
your classes through events.
Testing

Fixtures can be created in datasources other than $test. Models loaded 
using the ClassRegistry and using another datasource will get their 
datasource name prepended with test_ (e.g datasource master will try to use 
test_master in the testsuite)

A new TestShell has been added. It reduces the typing required to run unit 
tests, and offers a file path based UI::

B0x1A6
Console/cake test app/Model/Post.php
Console/cake test app/Controller/PostsController.php

Helpers
   
   -  tags now work inside elements correctly.
   - FormHelper now omits disabled fields from the secured fields hash. 
   This makes working with SecurityComponent and disabled inputs easier.
   - The between option when used in conjunction with radio inputs, now 
   behaves differently. The between value is now placed between the legend 
   and first input elements.
   - The hiddenField option with checkbox inputs can now be set to a 
   specific value such as 'N' rather than just 0.
   - The for attribute for date + time inputs now reflects the first 
   generated input. This may result in the for attribute changing for 
   generated datetime inputs.

Callback prioirites

Callbacks for Helpers, Behaviors, and Components now support priorities, 
this helps more easily control the order in which callbacks are fired.

We are working towards making the 2.1 book online in the next few hours and 
plan to finish the remaining features very soon. Thanks to the ever-growing 
CakePHP community for the patches, documentation changes and new tickets. 
Without you there would be no CakePHP!

   - Download a packaged release [1]
   - View the changelog [2]

Links
   
   - [1] http://github.com/cakephp/cakephp
   - [2] http://cakephp.org/changelogs/2.1.0-alpha

-- 
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


CakeEmail: getting error using example from Cake Book

2012-01-08 Thread Carlton
Asked this on Q&A also, but aren't sure which is more accurate/
appropriate place...

New to Cake and trying to learn by implementing some basic
functions... Trying out the CakeEmail function and getting the
following error:

 Fatal error: Call to a member function send() on a non-object
in/var/www/app/Model/Request.php on line 241

Called from the Request controller like this:

$this->Request->sendEmail(); // Send a confirmation email

Request Model method looks like this:

App::uses('AppModel', 'Model');
App::uses('CakeEmail', 'Network/Email');

// ... bunch of other functions

public function sendEmail() {
$email = new CakeEmail('gmail');
$email->from(array('m...@email.com' => 'MySite.com'))
->to('m...@email.com')
->subject('Request Created')
->message('Your request created successfully')
->send('My Message');

}

New to this so it's probably something basic... But I'm out of ideas.
Thanks in advance for the help

PS: also created the email.php as described...


public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => 'm...@email.com',
'password' => 'not telling',
'transport' => 'Smtp'
);

-- 
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


Starting with 1.13 or 2.0

2012-01-08 Thread Jerome Heuze - HEUZE Production
Hello Everyone!
Here is my new year resolution - start using CakePHP for my web apps
projects...

So for me to start should i be using/learning 1.x or 2.x version of
CakePHP?

You might want to know more about what i do - i am a front end
developer so i do deal more about html/css/js but outside of my daily
job i would like to be involve with both ends (backend and front end).

Thank you all. And Happy New year!

-- 
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 with dynamic templates

2012-01-08 Thread Thaissa Mendes
http://bin.cakephp.org/view/1119637582


On Sun, Jan 8, 2012 at 9:59 PM, Sam Sherlock  wrote:

> http://bin.cakephp.org/
>
> Or github gist.
>
> - S
> On 8 Jan 2012 20:42, "Thaissa Mendes"  wrote:
>
>> Hi,
>>
>> Not sure if it's the best approach, but when I did that I built a
>> component, who was calling the DB record, replacing the strings, set to a
>> default template, and sending the email.
>>
>> I can publish my component somewhere if you think it'll help.
>>
>> Thaissa.
>>
>> On Sun, Jan 8, 2012 at 6:05 PM, Arnold  wrote:
>>
>>> Hi, i want to use CakeEmail library to send email in some occasions.
>>>
>>> The issue i have is that i need to load the view template and layout
>>> from a field in DB and not from a file (this is because each user on
>>> my system can personalize email templates and layour), and also i have
>>> ###TEXT### on the templates that need to be replace.
>>>
>>> What is the best way to approach this goal?
>>>
>>> I know i have to do my own code for this, but can someone on list
>>> please guide me? how "should" i do this?
>>>
>>> --
>>> 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
>>
>  --
> 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: how to use the formatFileName option of the Uploader plugin of Miles Johnson?

2012-01-08 Thread Miles J
I noticed my docs are a bit out of date, updated them.

On Jan 7, 12:02 pm, franck  wrote:
> Hi guys,
>
> I am a real newbie in cakephp, I used to play with Symfony.
>
> I am trying to use the Uploader plugin of Miles Johnson to upload some
> pictures and attach them to a table, it sounds very good.
> I have test it on a simple table named Photos, which has two varchar
> fields : 'title' and 'uploadPath'.
>
> Everything is ok (after one day), ie I can upload pictures in a
> specific folders and attach it to the table. But I still can't make
> the formatFileName option work.
> As described in his tutorial, my Model/Photo.php looks like :
> public $actsAs = array(
>     'Uploader.Attachment' => array(
>         'fileName' => array(
>           'name'                => 'formatFilename',  // it doesn't
> work
>           'baseDir'             => '',
>           'uploadDir'           => 'upload',   // it works
>           'dbColumn'            => 'uploadPath',  // it works
> .);
>
> and I created the function formatFileName in the same file (Model/
> Photo.php):
> public function formatFilename($name, $field, $file) {
>      return md5($name);
>
> }
>
> And in my PhotosController, I have the function to add the pictures :
> public function add() {
>                 if($this->request->is('post')) {
>                         $this->Uploader = new Uploader();
>                         if ($this->Photo->save($this->request->data)) {
>                                 // Upload successful
>                                 $this->Session->setFlash('Upload photo 
> succeded');
>                         } else {
>                                 $this->Session->setFlash('Unable to upload');
>                         }
>                 }
>   }
>
> But it doesn't work, all my uploaded files are called
> formatFileName.jpg
>
> Do you have any idea of what I am doing wrong?
> Regards,

-- 
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: how to use the formatFileName option of the Uploader plugin of Miles Johnson?

2012-01-08 Thread Miles J
The function needs to be global, so take it out of the model.

On Jan 7, 12:02 pm, franck  wrote:
> Hi guys,
>
> I am a real newbie in cakephp, I used to play with Symfony.
>
> I am trying to use the Uploader plugin of Miles Johnson to upload some
> pictures and attach them to a table, it sounds very good.
> I have test it on a simple table named Photos, which has two varchar
> fields : 'title' and 'uploadPath'.
>
> Everything is ok (after one day), ie I can upload pictures in a
> specific folders and attach it to the table. But I still can't make
> the formatFileName option work.
> As described in his tutorial, my Model/Photo.php looks like :
> public $actsAs = array(
>     'Uploader.Attachment' => array(
>         'fileName' => array(
>           'name'                => 'formatFilename',  // it doesn't
> work
>           'baseDir'             => '',
>           'uploadDir'           => 'upload',   // it works
>           'dbColumn'            => 'uploadPath',  // it works
> .);
>
> and I created the function formatFileName in the same file (Model/
> Photo.php):
> public function formatFilename($name, $field, $file) {
>      return md5($name);
>
> }
>
> And in my PhotosController, I have the function to add the pictures :
> public function add() {
>                 if($this->request->is('post')) {
>                         $this->Uploader = new Uploader();
>                         if ($this->Photo->save($this->request->data)) {
>                                 // Upload successful
>                                 $this->Session->setFlash('Upload photo 
> succeded');
>                         } else {
>                                 $this->Session->setFlash('Unable to upload');
>                         }
>                 }
>   }
>
> But it doesn't work, all my uploaded files are called
> formatFileName.jpg
>
> Do you have any idea of what I am doing wrong?
> Regards,

-- 
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: Error Handler (Email not exist)

2012-01-08 Thread Sam Sherlock
Handle bounces
http://stackoverflow.com/questions/3139559/processing-an-email-bounce-back-in-cakephp-and-postfix

- S
On 7 Jan 2012 10:27, "majna"  wrote:

> I'm not sure wat are you doing, maybe
>
>   try {
>   ..send email
>   } catch (SocketException $e) {
>
>   ...redirect or inspect error: debug($e->getMessage());
>   }
>
>
>  --
> 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


Connect Cakephp 2.0 with Sql Server 2005

2012-01-08 Thread adhok
I have error connecting Cakephp 2.0 with Sql Server 2005, i tried to
replace file ntwdblib.dll V 2000.2.8.0 to V 2000.80.224.0 , also
i activated SQL Server Authentication.
Cake shows: Error: Sqlserver requires a database connection
Error: Confirm you have created the file : app
\Config\database.php (database.php is created, i'm sure)

-- 
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 with dynamic templates

2012-01-08 Thread Sam Sherlock
http://bin.cakephp.org/

Or github gist.

- S
On 8 Jan 2012 20:42, "Thaissa Mendes"  wrote:

> Hi,
>
> Not sure if it's the best approach, but when I did that I built a
> component, who was calling the DB record, replacing the strings, set to a
> default template, and sending the email.
>
> I can publish my component somewhere if you think it'll help.
>
> Thaissa.
>
> On Sun, Jan 8, 2012 at 6:05 PM, Arnold  wrote:
>
>> Hi, i want to use CakeEmail library to send email in some occasions.
>>
>> The issue i have is that i need to load the view template and layout
>> from a field in DB and not from a file (this is because each user on
>> my system can personalize email templates and layour), and also i have
>> ###TEXT### on the templates that need to be replace.
>>
>> What is the best way to approach this goal?
>>
>> I know i have to do my own code for this, but can someone on list
>> please guide me? how "should" i do this?
>>
>> --
>> 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
>

-- 
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 with dynamic templates

2012-01-08 Thread Thaissa Mendes
Hi,

Not sure if it's the best approach, but when I did that I built a
component, who was calling the DB record, replacing the strings, set to a
default template, and sending the email.

I can publish my component somewhere if you think it'll help.

Thaissa.

On Sun, Jan 8, 2012 at 6:05 PM, Arnold  wrote:

> Hi, i want to use CakeEmail library to send email in some occasions.
>
> The issue i have is that i need to load the view template and layout
> from a field in DB and not from a file (this is because each user on
> my system can personalize email templates and layour), and also i have
> ###TEXT### on the templates that need to be replace.
>
> What is the best way to approach this goal?
>
> I know i have to do my own code for this, but can someone on list
> please guide me? how "should" i do this?
>
> --
> 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


Model Association and Find

2012-01-08 Thread Fernando Nery Filho
Hello all!

I've been programming in PHP for a while now but just started to use Cake
in this new project I'm working.
I have 3 Table I'd like to Associate together: Movies, Actors and Cast

My Movie Model is set the following way:

*public $hasAndBelongsToMany = array(*

*'Elenco' => array(*

*'className'  => 'Personalidade',*

*'joinTable'  => 'filmes_personalidades',*

*'foreignKey' => 'filme_id',*

*'associationForeignKey'  => 'personalidade_id',*

*'unique' => true,*

*'fields' => 'id,nome'*

*)*

);


When I use $this->Filme->find('all') it works fine and all the Actors are
selected correctly.
But when I try to filter movies that have a selected actor using:

*$this->set('filmes', $this->Filme->find('all', array(*

*'conditions' => array("Elenco.id" => array($personalidade_id)),*

*'limit' => 20,*

*'page' => $pagina*

*)));*


Cake tells me "*SQLSTATE[42S22]:* Column not found: 1054 Unknown column
'Elenco.id' in 'where clause'".

What am I doing wrong?
Thanks for the support in advance!

Fernando Nery Filho*
*

-- 
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: FormHelper::input() overwrite causes memory exhausted

2012-01-08 Thread 清水紘己
inputs() internally uses input() so infinite loop was caused.

2012/1/9 func0der :
> Hey guys,
>
> just tried to create a Translation helper in cakephp 2.0.
>
> So i created  a TranslationHelper which extends the FormHelper. I
> created a public function named "input" which obviously overwrites the
> input function of the FormHelper.
>
> Everytime i call it with $this->Translation->input('Product.name'); in
> a view i get an memory exhausted error and i don't know why.
>
> The Code for the TranslationHelper is this: http://pastebin.com/uuZMfCC8
>
> Can anyone explain me why this i happening?
>
> Greetings
> func0der
>
> --
> 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


FormHelper::input() overwrite causes memory exhausted

2012-01-08 Thread func0der
Hey guys,

just tried to create a Translation helper in cakephp 2.0.

So i created  a TranslationHelper which extends the FormHelper. I
created a public function named "input" which obviously overwrites the
input function of the FormHelper.

Everytime i call it with $this->Translation->input('Product.name'); in
a view i get an memory exhausted error and i don't know why.

The Code for the TranslationHelper is this: http://pastebin.com/uuZMfCC8

Can anyone explain me why this i happening?

Greetings
func0der

-- 
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: Having PHP generate a PDF

2012-01-08 Thread luca capra

Hi,
dompdf is based on tcpdf but take care of "translating" html/css to pdf, 
and support either inner php code.


Il 04/01/2012 18:22, Tonu Tusk ha scritto:

TCPDF can do this - I have it do it on pdfs I am generating.

I'll try and post more details shortly.

On Jan 4, 3:25 pm, "Yves S. Garret"
wrote:

It does do the header and footers for me.  The problem that I am running
into is that I do not see the title per column being set to show again on
every page.  I am assuming that this is caused TCPDF is taking HTML code
and turning it into PDF, which is an inherent limitation in HTML in the
first place.



--
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 with dynamic templates

2012-01-08 Thread Tilen Majerle
create layout for email and put into: 
Then, create an element for email with content: 
and in you code, retrieve layout code from database, replace what you need
and this content set to this element :)
it will print just what you set :)

Understand ? :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/1/8 Arnold 

> Hi, i want to use CakeEmail library to send email in some occasions.
>
> The issue i have is that i need to load the view template and layout
> from a field in DB and not from a file (this is because each user on
> my system can personalize email templates and layour), and also i have
> ###TEXT### on the templates that need to be replace.
>
> What is the best way to approach this goal?
>
> I know i have to do my own code for this, but can someone on list
> please guide me? how "should" i do this?
>
> --
> 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


CakeEmail with dynamic templates

2012-01-08 Thread Arnold
Hi, i want to use CakeEmail library to send email in some occasions.

The issue i have is that i need to load the view template and layout
from a field in DB and not from a file (this is because each user on
my system can personalize email templates and layour), and also i have
###TEXT### on the templates that need to be replace.

What is the best way to approach this goal?

I know i have to do my own code for this, but can someone on list
please guide me? how "should" i do this?

-- 
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


Redirect to static page not working

2012-01-08 Thread Daniel
I am trying to redirect to a static page from a controller (users add)
using:
$this->redirect('/pages/email_sent');

... but I get sent to the users login view.  The same happens if I try
to type the url into the browser:
localhost/myapp/pages/email_sent

Note I have the auth component set up as follows:
$this->Auth->allow('index', 'view');
$this->Auth->loginRedirect = array('controller'=>'posts', 'action' =>
'index');
$this->Auth->logoutRedirect = array('controller'=>'posts', 'action' =>
'index');

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


Re: Error using CakeEmail

2012-01-08 Thread Daniel
Thanks.  I got it working and I didn't need smtpOptions.

-- 
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


Multiple Upload Cakephp - Help Me

2012-01-08 Thread Noer barrihadianto
Dear Milis Team

I am having difficulty in making multiple upload cakephp, whether it can be
assisted by a team mailing list and be given examples of source code.

thank you



Barry

-- 
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: Loading of plugins in AppController::beforeFilter

2012-01-08 Thread VuuRWerK
Argh, damn xD The good old ClassRegistry, totally forgotten, thanks
for the hint!

-- Christian

On Jan 5, 11:16 pm, majna  wrote:
> You can load plugins form db in bootstrap.php too:
>
> $pluginHooks  = ClasRegistry::init('PluginHook')->find('all');
> foreach ( $pluginHooks as $pluginHook ) ...
>
> and then Configure::write('plugins', $plugins) for your hooks to be
> available in views as Configure::read('plugins');

-- 
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: Error using CakeEmail

2012-01-08 Thread majna
What is smtpOptions() method? You shoul read Cake docs on how to configure 
email server outside controller, in Config/email.php

Anyway, add 'transport' => 'Smtp'
By default, Cake uses PHP mail() to send emails. I think xampp on windows 
needs smtp server installed and configured to be able to do so.

You can also dump raw email to tmp/logs by using 
$email = new CakeEmail(arra('log' => true)); 

-- 
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


Use Vagrant to develop CakePHP applications

2012-01-08 Thread Matteo Landi
Hi guys,

I would like to share with you a small article [1] I wrote which describes how
to use Vagrant to create a customized development virtual environment for
CakePHP: hope this doesn't get tagged as spammy! 

If you have any comments, advices or whatever you want, don't be shy: I will
try my best to answer you.


Regards,
Matteo

[1] http://matteolandi.blogspot.com/2012/01/about-cakephp-and-vagrant.html

-- 
http://www.matteolandi.net

-- 
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: Model for competition

2012-01-08 Thread Mattijs
Hi,

I'd say you got it pretty much pinned till the part where judges come
in. As I understand it, you want to make a link between judge type and
criteria, so I'd suggest either of the following:

a) you introduce a 'type' table, and have both judges and criteria
relate to this. Then, you could show criteria with the same type_id as
the judge. Drawback is that you get a 1-on-1 mapping (so project judge
<> project criteria) and no possibility to extend (for example,
general judge <> all criteria, project judge <> project criteria)
b) extend a by adding an m:n relation between type and judge. Then you
can set multiple criterion-types to a judge.

That way, you should be able to gather most information through
queries. One more suggestion: CakePHP plays bad with composite primary
keys, so you may want to add an ID field to events_teams so that you
can use that to refer to from the scores table.

Hth

On 8 jan, 00:35, Ivan  wrote:
> Hi every one,
> I am working in a project, that is basicaly, a competition manager,
> where organizers can register, and then have access to those things:
> - Include Teams from a database
> - Register new teams in database
> - View only the events created by himself
> - Include in each event, criteria, like: Project score, Building
> score, Practice score...
>
> Judges, would have access to:
> - Post scores to the existing criteria created by the organizer
> - Give comments to the teams, so that a team can have many comments in
> one participating event
>
> Scores would never be deleted, the "right" one would be the newer one
>
> After doing that i want to make something like this:
> Judge can only give scores to the criteria set to it`s user, so a
> Project judge, can only give scores to the Project score.(don`t know
> how to make that in db)
>
> The thing, is that each event has many criterias, and that each
> criteria have many scores with its type, but they are also linked with
> the teams participating in the event. I`m VERY confused at this..
> Here is what i have done, with the database in MySQL 
> Workbench:http://cl.ly/2r3F25232u1d303x2D2u
>
> I apreciate, if anyone could tell me, if i`m in the right direction,
> and if not, what can i do to make it work good.
>
> Thanks everyone,
> Ivan

-- 
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: Change delete($id) function to delete from a non-primary key.

2012-01-08 Thread Tilen Majerle
before you call Model::delete($id), change primary key (on the fly)

function delete($id) {
   if (!$this->request->is('post')) {
   throw new MethodNotAllowedException();
   }

   if($this->isActionable($id)){
$this->Student->primaryKey = 'period_id'; ///AEEED :)
   if ($this->Student->delete($id)) {
   $this->Session->setFlash('Successfully removed.');
   $this->redirect(array('controller' => 'posts', 'action' =>
'index'));
   }
   } else {
   $this->Session->setFlash('You cannot delete that.');
   $this->redirect(array('controller' => 'posts', 'action'
=>
'index'));
   }
   }
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/1/8 GG 

> My delete function (below) is getting the right info from the
> index.ctp but, it is trying to delete using the primary key of
> 'unique'... I'm sure the work needs to be done in the model, and I
> don't want to change the primary key. I want ONLY the delete function
> to delete from the field 'period_id' instead of 'unique'.
>
> P.S. If i change the primary key in my model to 'unique', it fixes
> this problem, but breaks another. Thanks!
> - - - - - -
> Here is my StudentsController.php
>
>
> function delete($id) {
>if (!$this->request->is('post')) {
>throw new MethodNotAllowedException();
>}
>
>if($this->isActionable($id)){
>if ($this->Student->delete($id)) {
>$this->Session->setFlash('Successfully removed.');
>$this->redirect(array('controller' => 'posts', 'action' =>
> 'index'));
>}
>} else {
>$this->Session->setFlash('You cannot delete that.');
>$this->redirect(array('controller' => 'posts', 'action'
> =>
> 'index'));
>}
>}
>
>
> - - - - - -  - - -
> Here is my index.ctp
>
>
> $this->Form->postLink(
>'Remove Class',
>array('controller' => 'students', 'action'
> => 'delete', $ps['Period']['period_id']),
>array('confirm' => 'Are you sure?'));
>
> --
> 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