Re: CakePHP help

2012-09-10 Thread jeet bajaj
Then what is the problem???


On Sun, Sep 9, 2012 at 7:15 PM, girl narehtaras...@gmail.com wrote:

 hmm I made such a small game:  http://www.wordgame.armfree.ru/

 I wrote it's code... now I need  it with cake but I have some
 difficulties

 I can show usual php code.. it's not very big :/

  --
 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: How to link to a non cake php page, and where to put it?

2012-09-10 Thread Mike Griffin
On Sun, Sep 9, 2012 at 11:50 PM, d6games mark.deib...@gmail.com wrote:
 I need to do this too. Sadly, this doesn't work in version 2.2. In my
 index.ctp view I have a standard hyperlink like...

 ?php echo a href='joingame.html'Join/a ?

 Which renders the correct link, but when I click it I get...

 Error: Joingame.htmlController could not be found.

 Error: Create the class Joingame.htmlController below in file:
 app/Controller/Joingame.htmlController.php


 How can I link to a non-CakePHP app?

Use the correct link. Where is the joingame.html located? If it's in
the cakePHP folder, you will have to mess with the .htaccess file so
that cake doesn't try to intercept it. If it's outside the cakePHP
folder, either use the absolute path or a relative path to get to it.

Can you view the file on its own?

Mike.

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




Miles J Uploader

2012-09-10 Thread CrotchFrog
I'm using Miles J Uploader plugin and Cake 2.2.2. I've configured the 
plugin in my model as $actsAs = Uploader.attachment. 
What I'm having problems with is that I have a custom function in the 
bootstrap to save the file with a unique filename and that works ok
but its saves the record in the database with the original name of the 
uploaded file. Any idea how to get the two filenames to match? 

Please see Pastebin: 
http://bin.cakephp.org/view/70326247 

- ED

-- 
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: Miles J Uploader

2012-09-10 Thread Johannes N
well, probably it's the

'name' = 'name' // Saves the file in database with actual name of uploaded 
file

line. :) i would strip down the code to the only needed lines, so you would 
end with:



   1. 'Uploader.Attachment' = array http://www.php.net/array(
   2. 'fileName' = array http://www.php.net/array(
   3. 'name'  = 'generateFilename',
   4. 'dbColumn'  = 'path',  
   5. 'overwrite' = false,   
   6. 'stopSave'  = true,
   7. 'allowEmpty'= false,   
   8. );
   

greetings,

On Monday, September 10, 2012 2:01:16 PM UTC+2, CrotchFrog wrote:

 I'm using Miles J Uploader plugin and Cake 2.2.2. I've configured the 
 plugin in my model as $actsAs = Uploader.attachment. 
 What I'm having problems with is that I have a custom function in the 
 bootstrap to save the file with a unique filename and that works ok
 but its saves the record in the database with the original name of the 
 uploaded file. Any idea how to get the two filenames to match? 

 Please see Pastebin: 
 http://bin.cakephp.org/view/70326247 

 - ED


-- 
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: Miles J Uploader

2012-09-10 Thread Ed Propsner
Thanks Johannes,

When I try stripping down it saves the record in the database with name
as empty.

On Mon, Sep 10, 2012 at 8:12 AM, Johannes N johannes.n...@socialisten.atwrote:

 well, probably it's the

 'name' = 'name' // Saves the file in database with actual name of
 uploaded file

 line. :) i would strip down the code to the only needed lines, so you
 would end with:



1. 'Uploader.Attachment' = array http://www.php.net/array(
2. 'fileName' = array http://www.php.net/array(
3. 'name'  = 'generateFilename',
4. 'dbColumn'  = 'path',
5. 'overwrite' = false,
6. 'stopSave'  = true,
7. 'allowEmpty'= false,
8. );


 greetings,

 On Monday, September 10, 2012 2:01:16 PM UTC+2, CrotchFrog wrote:

 I'm using Miles J Uploader plugin and Cake 2.2.2. I've configured the
 plugin in my model as $actsAs = Uploader.attachment.
 What I'm having problems with is that I have a custom function in the
 bootstrap to save the file with a unique filename and that works ok
 but its saves the record in the database with the original name of the
 uploaded file. Any idea how to get the two filenames to match?

 Please see Pastebin:
 http://bin.cakephp.org/view/**70326247http://bin.cakephp.org/view/70326247


 - ED

  --
 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: HABTM save Question

2012-09-10 Thread gloop
Hi, sorry for my late response.

I tested some ways and now i can save/edit.

  public function edit($id = null){
if(empty($id)) $this-redirect('index');
if(!$this-request-is('get')){
  $data = $this-request-data;
  $this-Translation-save($data['Translation']);
  $_data = array();
  foreach($data['Language'] as $key = $value){
  $_data[] = array(
  'id' = $value['LanguagesTranslation']['id'],
  'translation_id' = $id,
'language_id' = $value['id'],
  'value' = $value['LanguagesTranslation']['value']
  );
  }
  $this-Translation-LanguagesTranslation-saveAll($_data);
  $this-redirect('index');
}

$this-Translation-id = $id;
$r = $this-Translation-read();
$this-request-data = $r;
$this-loadModel('Language');
$this-set('languages', $this-Language-find('all'));
  }

Thats ok, but i dont know how i can validate the joinTable, cause i must 
call 2 save functions.

Well ... maybe u know a better way,

On Friday, September 7, 2012 5:25:17 AM UTC+2, Mohammad Naghavi wrote:

 Hi Steffen,
 what is wrong with
 $this-Translation-LanguagesTranslation-save()

 that you need a better way?


 On Thu, Sep 6, 2012 at 3:25 PM, gloop gl...@web.de javascript: wrote:

 Hello,

 is there a way to save directly to the joining table? Like the find data?

 Model Translation HABTM Translation:

 $data = array(
 'Translation' = array(
 'key' = '213152374'
 ),
 'Language' = array(
 array(
 'id' = '1',
 'LanguagesTranslation' = array(
 'value' = 'Das ist ein Test'
 )
 ),
 array(
 'id' = '2',
 'LanguagesTranslation' = array(
 'value' = 'This is a test'
 )
 )
 )
 );
 $this-Translation-saveAll($data);


 How i can fill the additional field?

 I know i can use $this-Translation-LanguagesTranslation-save() bu is 
 there a better way?

 Tanks
 Steffen

  -- 
 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: How to link to a non cake php page, and where to put it?

2012-09-10 Thread d6games
I moved the non-cake PHP app into the cake webroot folder and now it seems 
to be working. The bit about .htaccess is interesting. I didn't think about 
that.

On Monday, September 10, 2012 4:08:47 AM UTC-4, Mike Griffin wrote:

 On Sun, Sep 9, 2012 at 11:50 PM, d6games mark.d...@gmail.comjavascript: 
 wrote: 
  I need to do this too. Sadly, this doesn't work in version 2.2. In my 
  index.ctp view I have a standard hyperlink like... 
  
  ?php echo a href='joingame.html'Join/a ? 
  
  Which renders the correct link, but when I click it I get... 
  
  Error: Joingame.htmlController could not be found. 
  
  Error: Create the class Joingame.htmlController below in file: 
  app/Controller/Joingame.htmlController.php 
  
  
  How can I link to a non-CakePHP app? 

 Use the correct link. Where is the joingame.html located? If it's in 
 the cakePHP folder, you will have to mess with the .htaccess file so 
 that cake doesn't try to intercept it. If it's outside the cakePHP 
 folder, either use the absolute path or a relative path to get to it. 

 Can you view the file on its own? 

 Mike. 


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




CakePHP 1.1 and PostgreSQL 9.1.x

2012-09-10 Thread keogh
Hi everyone,

I'm working on a legacy project that uses CakePHP 1.1, I know we should 
update it, but the client doesnt want that yet. Well it works perfectly in 
my local with PostgreSQL 8.4.13, but when I try to deploy it with 
PostgreSQL 9.1.5 I get the error: Missing Database Table.

My question is, does CakePHP 1.1 supports PostgreSQL 9.1.x? I'm thinking 
the error I'm getting it's because CakePHP 1.1 doesn't support PostgreSQL 
9.1.x. What do you think?

Regards,


Isaac Zepeda

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




create a link to download file

2012-09-10 Thread Arie Yuniarto
Hi all,

I wanna ask about create a link to download file.

so in my view i add this code

?php echo $html-link('Download CSV',array( action = download)); ?


and then i use Media View on the controller

function download(){

 $this-view = 'Media';
 $params = array(
 'id' = 'clipping.zip',
 'name' = 'clipping',
 'mimeType' = 'text/csv csv',
 'download' = true,
 'extension' = 'csv',
 'path' = APP . 'data/csv/' . DS
 );

 $this-set($params);
 $this-autoLayout = false;

 }



but  have this error :


 *Error: * The requested address *'/somecontrollers/download'* was not 
 found on this server. 



how do i fix this??

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

2012-09-10 Thread schaenk
Got the same problem. But the solution is easy. Delete the 
header(Content-Type: application/pdf); line in your layout file.

Just put this line into your controller action instead:
$this-RequestHandler-respondAs(pdf);

Works fine with CakePHP 2.x

Cheers

On Thursday, July 26, 2012 12:04:32 AM UTC+2, gloop wrote:

 Hello,

 i would like to create a pdf. Now i found this:


 http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf

 So i try this example:

 Step: 1, 2, 3 the same as the example

 Step 4:

   function viewPdf() {
 $this-layout = 'pdf'; //this will use the pdf.ctp layout
 $this-render(); 
 } 

 Step 5:

 ?php 
 App::import('Vendor','xtcpdf');  
 $tcpdf = new XTCPDF(); 
 $textfont = 'freesans'; // looks better, finer, and more condensed than 
 'dejavusans' 

 $tcpdf-Cell(0,14, Hello World, 0,1,'L'); 
 echo $tcpdf-Output('filename.pdf', 'D'); 
 ?

 When i open function in a browser i get a download popup and i have to 
 choose how i would open the document. The standard software is firefox.

 I try 

 echo $tcpdf-Output('filename.pdf', 'D');

 and i see many text (like i open the pdf with firefox. I check the http 
 header and see the document is opend with Content-Type: text/html; 
 charset=UTF-8


 I try:

 In the controller $this-header('Content-type: application/pdf'); andheader(
 'Content-type: application/pdf');

 But i get always the wrong content-type.

 How i can change the content type?

 Thanks for help.
 gloop


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




Problem with paths to files

2012-09-10 Thread Petr Juráček
Hello,
*(I apologize in advance for my bad English.)*

my CakePHP incorrectly lists paths to files (css files, images, 
javascripts...).
CakePHP always before the path adds */app/webroot/index.php/*

For example:
CakePHP makes link: */app/webroot/index.php/css/style.css
*but* *correctly should be link:*/css/style.css*


My file structure:
   
   - hosting/
  - www/
 - mydomain.com/
- www/
   - .htaccess
   - app/
   - .htaccess
  - webroot/
 - .htacces
 - index.php
 

In */hosting/www/mydomain.com* is located symlink that redirects always to *
/hosting/www/mydomain.com/www*.

*I don't know if it has an effect file .htaccess and therefore I write:*


/hosting/www/mydomain.com/www/.htaccess

IfModule mod_rewrite.c
   RewriteEngine on
   RewriteBase /
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]
/IfModule



/hosting/www/mydomain.com/www/app/.htaccess

IfModule mod_rewrite.c
   RewriteEngine on
   RewriteBase/
   RewriteRule^$webroot/[L]
   RewriteRule(.*) webroot/$1[L]
/IfModule




/hosting/www/mydomain.com/www/app/webroot/.htaccess

IfModule mod_rewrite.c
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
/IfModule


*Please advice.*

-- 
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: create a link to download file

2012-09-10 Thread Yasir Arafat Hasib
Hello

Check the link i think this will help you

http://arafats.info/cakephp-download-me goog_1838343105dia/ /



On Tue, Sep 11, 2012 at 8:05 AM, Arie Yuniarto scs.arie...@gmail.comwrote:

 Hi all,

 I wanna ask about create a link to download file.

 so in my view i add this code

 ?php echo $html-link('Download CSV',array( action = download)); ?


 and then i use Media View on the controller

 function download(){

 $this-view = 'Media';
 $params = array(
 'id' = 'clipping.zip',
 'name' = 'clipping',
 'mimeType' = 'text/csv csv',
 'download' = true,
 'extension' = 'csv',
 'path' = APP . 'data/csv/' . DS
 );

 $this-set($params);
 $this-autoLayout = false;

 }



 but  have this error :


 *Error: * The requested address *'/somecontrollers/download'* was not
 found on this server.



 how do i fix this??

  --
 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.
-
Yasir Arafat (Hasib)*
*Deputy Project Manager, *Software Solutions
Grameen Solutions
Contact Information:
**
**
Cell : +8801816 536 901, +880197 *333* 2 888
Web: http://arafats.info
http://arafats.info

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