app-controllers-pages_controller

2012-02-12 Thread Sean
Hello all,

This is the first time I have posted. I am relatively new to cakePHP.
I have been working with an application and have run into something
strange. My app/controllers/pages_controller is acting very strange.

It works just fine in my development environment. I can view, add,
edit and delete pages. I uploaded it into my host and now it doesn't
work. At one point, it did, but now it's acting up.

I first discovered the issue a couple of days ago when I tried to edit
a page. When I tried to save it, it redirected me to the edit page and
deleted my changes.

It shows old pages in the views. I even made my changes in my
development environment and imported the SQL into the database
manually.

I tried deleting the pages and according to the list in my admin area,
they are gone, but the database shows that they are still there.

This is all very strange. Has anyone seen this before? My site is on
the live server, but our site hasn't officially gone live. These are
important informational pages that need to be viewable and accurate.
How could this work in one environment and stop working in another?

Any help would be appreciated.

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: CakeEmail - attachments

2012-02-12 Thread phpMagpie
OK, I ended up with a solution which saved me making an extra request when 
I realised I could render /bookings/invoice/%id%.pdf into a variable and 
temporarily save that to the server to be attached:

  public function sendConfirmation() {
$email = new CakeEmail('default');
$booking = $this-Booking-find('first', array(
  'conditions'=array('Booking.id'=$this-Booking-id),
));
$email-viewVars(array(
  'booking' = $booking
));

$invoicePath = $this-getTmpFile();
$email-template('Bookings/confirmation', 'default')
  -emailformat('both')
  -to($booking['Organisation']['bookings_email'])
  -subject('NEAS Training System: Booking Confirmation')
  -attachments(array('invoice.pdf'=$invoicePath))
  -send();
unlink($invoicePath);
  }
  
  public function getTmpFile() {
$this-autoRender = false;
$view = new View($this, false);
$view-set('booking', $this-Booking-find('first', array(
  'conditions' = array('Booking.id' = $this-Booking-id)
)));
$view-viewPath = 'Bookings';
$file = $view-render('pdf/invoice', 'pdf/default');
$filename = TMP . 'invoice-'.$this-Booking-id.'.pdf';
$handle = fopen($filename, 'w+');
fwrite($handle, $file);
fclose($handle);
return $filename;
  }

There may be a better way to render a view into a variable, but I got this 
method from reading:
http://wp.headynation.com/cakephp-get-htmloutput-of-view-without-view-displaying-or-outputting-using-render/
 

HTH, Paul.

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


cake keeps outputting errors despite debug=0

2012-02-12 Thread Tomfox Wiranata
Hi everyone,

I use postgres as the database. when saving data and having debug=2
cake threw these errors

Warning (2): pg_query() [function.pg-query]: Query failed: FEHLER:
NULL-Wert in Spalte »title« verletzt Not-Null-Constraint [CORE\cake
\libs\model\datasources\dbo\dbo_postgres.php, line 167]

Warning (512): SQL Error: FEHLER:  NULL-Wert in Spalte »title«
verletzt Not-Null-Constraint [CORE\cake\libs\model\datasources
\dbo_source.php, line 673]

Query: INSERT INTO books (fk_user_id, hash, created) VALUES
('761966711', '1', 'bc1c6d1df862ef59aaa1019b325eae49ad98910',
'2012-02-11 17:52:29')

{successful:false}


NOW I thought setting debug=0 makes both errors not showing, INSTEAD
just the Warning (512): SQL Error: FEHLER: is not debugged.

the Warning (2): pg_query() is still debugged. since this is a
postgres thing i guess the cakes debug parameter wont apply here? or
am i missing sth?

what do i need to do?

thx :)

-- 
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 schema and foreign key

2012-02-12 Thread Mohammad Naghavi
Hi every body,
I knew that in cakephp 1.3 was not possible to implement the foreign keys
and such a relation between two tables with cake's schema. Now I read the
cake 2's book page for schema and it seems in this matter nothing is
changed and foreign keys are still not supported with schema, I wanted to
ask the ones who already used the schema feature if I'm right? does cake 2
still not support the foreign keys?

thanks for any answers in forward,
MN

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


error en shelldispacher.php when i want to execute the cake bake

2012-02-12 Thread Ogalav
hello,

i have this error when gonna to executed the cake bake since console
ssh

/web_ftp/web/intranet/app   ./Console/cake
br /
bParse error/b:  syntax error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in b/homepages/14/
d392848574/htdocs/benjatel2010/web_ftp/web/intranet/lib/Cake/Console/
ShellDispatcher.php/b on line b32/bbr /


thanl for you help.

-- 
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: app-controllers-pages_controller

2012-02-12 Thread phpMagpie
Sounds like there is something wrong with your code and without seeing it 
hard to debug.  You also mention lots of different errors with editing, 
deleting etc.

Find the the most concise piece of code that you believe should be working 
but isn't.  Paste that code to pastebin (http://bin.cakephp.org) and 
provide a link here along with what you think should be happening and what 
is happening instead.

If your site is live, it can also help to tell us at what address so we can 
see the error for ourselves.

-- 
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: Radio box css

2012-02-12 Thread phpMagpie
The form helper was never intended to do this and as such I'm not aware of 
any easy way to make it do so.

I think you'd have to manually create each radio option either inserting an 
image into the label or applying a class to each radio option and using CSS 
to image replace (the most accessible method).

-- 
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: Radio box css

2012-02-12 Thread Marus
how to setup different css classes for 1 form-radio ?
or i have to loop them as you told me and add the class option in the radio
?


On Sun, Feb 12, 2012 at 5:40 PM, phpMagpie p...@webbedit.co.uk wrote:

 The form helper was never intended to do this and as such I'm not aware of
 any easy way to make it do so.

 I think you'd have to manually create each radio option either inserting
 an image into the label or applying a class to each radio option and using
 CSS to image replace (the most accessible method).

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




-- 
-
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such a case, you should destroy this message and
kindly notify the sender by reply e-mail.

-- 
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: Send user to specific controller/action from front page?

2012-02-12 Thread Daniel
$this-redirect(array('controller'='posts','action'='index'));

... placed in the pages controllers display function does indeed
redirect.  The problem is that I want it to redirect only from the
front / root page and not from any other static pages:

public function display() {
$path = func_get_args();

if (*front / root page*)
$this-redirect(array('controller'='posts','action'='index'));
else {
$count = count($path);
if (!$count) {
$this-redirect('/');
}
$page = $subpage = $title_for_layout = null;

if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 
1]);
}
$this-set(compact('page', 'subpage', 'title_for_layout'));
$this-render(implode('/', $path));
}
}

-- 
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: Send user to specific controller/action from front page?

2012-02-12 Thread Daniel
On Feb 11, 7:58 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote:
 You need to modify routes.php in your Config folder that is inside
 your app.


Oh yeah, that is an easier solution.

-- 
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: Radio box css

2012-02-12 Thread phpMagpie
Exactly, AFAIK FormHelper was not written to deal with treating each radio 
option differently (same way as it can't delete with options in a checkbox 
or select list differently), so to achieve that you will have to create 
your radio options manually.

-- 
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: Radio box css

2012-02-12 Thread Marus
Thanks alot

On Sun, Feb 12, 2012 at 7:10 PM, phpMagpie p...@webbedit.co.uk wrote:

 Exactly, AFAIK FormHelper was not written to deal with treating each radio
 option differently (same way as it can't delete with options in a checkbox
 or select list differently), so to achieve that you will have to create
 your radio options manually.

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




-- 
-
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such a case, you should destroy this message and
kindly notify the sender by reply e-mail.

-- 
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 en shelldispacher.php when i want to execute the cake bake

2012-02-12 Thread Sam Sherlock
what version of php have you got available.

note that cake requires php 5.2.8+ (this was upped recently)

also if you have set a specific version for php from you server the cli
will need to be set differently.

$ php -v

if the version you running is less than the required (I think you have 4 by
default)

check with host to see how you can set the php for cli to 5.2.8+
 - S




On 12 February 2012 13:52, Ogalav omar...@gmail.com wrote:

 hello,

 i have this error when gonna to executed the cake bake since console
 ssh

 /web_ftp/web/intranet/app   ./Console/cake
 br /
 bParse error/b:  syntax error, unexpected T_STRING, expecting
 T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in b/homepages/14/
 d392848574/htdocs/benjatel2010/web_ftp/web/intranet/lib/Cake/Console/
 ShellDispatcher.php/b on line b32/bbr /


 thanl for you help.

 --
 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: datetime array to string

2012-02-12 Thread Daniel
I don't know if there exists a specific function or not, but check out
the php functions: date, strtotime and implode.

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


View magic similar to form automagic

2012-02-12 Thread kdubya
In section 7.3.3 of the manual, it talks about form automagic that is
really cool and simplifies forms greatly. Specifically I'm talking
about, the example of, in the controller doing:
$this-set('groups', $this-User-Group-find('list'));

and then in the form:
echo $this-Form-input('Group');

This will create a multiselect form element assuming the table groups
has id and name fields. The select will display the contents of the
name field and the value stored in the table will be the id value for
that row in the table.

My question is: is there some similar view magic built in to CakePHP
that when I just want to display the groups that the user belongs to
(not in an edit form), that will output the contents of the name field
instead of the id field.

I know I can do the lookup myself and even put in an afterFind() or
beforeRnder() call to do the conversion automatically, but, I was
wondering if there was something built-in that I had missed? It would
probably be an HTML helper call but I can't find it.

Thanks,
Ken

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


How to embebedd flash menu buttons on my site?

2012-02-12 Thread Devis
I own a website based on phpcake.
I bought even a flash buttons menu for my site, but i dont know how to
replace these buttons with the default one.
I tried to read but i am confused.
Someone can help me with this problem?
Thanks in advance to everyone.

-- 
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: View magic similar to form automagic

2012-02-12 Thread kdubya
Actually, the more I think about this I realize this cannot be done
with some magic in the view. I'll have to do it in the controller or
the model. Never mind.

However, any suggestions of the best way to do this in the model or
controller would be appreciated. I can think of a SQL query using a
JOIN but I'm not sure how to force CakePHP to use a join in a model
association. BTW I'm using CakePHP 1.3

Ken

-- 
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 embebedd flash menu buttons on my site?

2012-02-12 Thread Sam Sherlock
Once you understand how to src files in webroot all you need to is place
the file and ref with you object/embed mark up.

Use firebug or such to check that files are found.

Unless your using cake internal routing webroot/ should not be part of the
url.

 - S
On 12 Feb 2012 21:52, Devis devisdemkoll...@gmail.com wrote:

 I own a website based on phpcake.
 I bought even a flash buttons menu for my site, but i dont know how to
 replace these buttons with the default one.
 I tried to read but i am confused.
 Someone can help me with this problem?
 Thanks in advance to everyone.

 --
 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: View magic similar to form automagic

2012-02-12 Thread Tilen Majerle
When u call find method...second parameter is for params...you can use
fields keu in this array and set which fields to use...look at cakephp book
for this

Dne nedelja, 12. februar 2012 je pošiljatelj kdubya 
kenwin...@winanstech.com napisal:
 Actually, the more I think about this I realize this cannot be done
 with some magic in the view. I'll have to do it in the controller or
 the model. Never mind.

 However, any suggestions of the best way to do this in the model or
 controller would be appreciated. I can think of a SQL query using a
 JOIN but I'm not sure how to force CakePHP to use a join in a model
 association. BTW I'm using CakePHP 1.3

 Ken

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


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

-- 
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: View magic similar to form automagic

2012-02-12 Thread kdubya
Thank you, your suggestion was helpful regarding joins.
Ken

-- 
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: Helper aliasing acting weird in 2.1 Beta

2012-02-12 Thread Ernesto
Hi Lorenzo, thanks for the response :)

You're right, CakePHP loads my TableHelper instead of loading 
PdftableHelper and aliasing it.

i think this is a bug. Can you test it?

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