Re: How to pass parameter with '/' into URL?

2012-09-18 Thread euromark
cakephp is still php.
try to use urlescape() or rawurlescape()

if you plan on passing a lot of those special characters you can also try 
to use base64encode and decode as the Search plugin does


Am Dienstag, 18. September 2012 14:09:51 UTC+2 schrieb Lightee:
>
> Dear CakePHP experts,
>
> When passing parameters through URL, it will look like something below;
> mysite.com/myController/myAction/param1/param2
>
> My problem is that my parameters also happen to contain characters like 
> '/'. Is there some sort of escape character to overcome this problem?
>
> Thank you very much for your help.
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: How to implement the Remember Me with Auth?

2012-09-16 Thread euromark
http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/ 
is one easy way (only adding the component).

but since 2.x there is also some CookieAuth (i never tried before, though):
https://github.com/ceeram/Authenticate/blob/master/Controller/Component/Auth/CookieAuthenticate.php
 


Am Sonntag, 16. September 2012 16:00:51 UTC+2 schrieb tomtom:
>
> Hello,
>
> I have successfully used Auth, but unfortunately, it seems that it does 
> work only with Session. I want that if user check "Remember Me" checkbox, I 
> would use Cookie and he would be logged in for 2 weeks. I can't find 
> anything in official book and in Google I found just few and not great blog 
> posts. Is there any easy way to implement this? Thanks.
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: How do i validate multiple fields using the same field name?

2012-09-16 Thread euromark
have you ever seen validates() taking arguments? especially $data? nope

$this->Model->set($this->request->data)
$result = $this->Model->validates()

as the book describes



Am Sonntag, 16. September 2012 20:09:24 UTC+2 schrieb resting:
>
> Created a test setup with v2.2.0
>
> Validation doesn't work.
> Empty fields still pass.
>
> What am I doing wrong here?
>
> Full source: 
> https://github.com/resting/cakephp/blob/test_validation/app/Controller/MyFormController.php
>
> On Friday, 14 September 2012 15:42:36 UTC+8, resting wrote:
>>
>> I have something like this in my view: 
>>
>> echo $this->Form->input('Modelname.1.fieldname');
>>
>> (ref: 
>> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#field-naming-conventions)
>>  
>>
>>
>> I have this in my model: 
>>
>> public $validate = array(
>> 'filename' => array('ruleFilenameEmpty' => array('rule' => 
>> 'notEmpty', 'required' => true, 'allowEmpty' => false, 'last' => true)));
>>
>> This is the structure of $this->request->data: 
>>
>> array(
>> 'Capture' => array(
>> (int) 0 => array(
>> 'filename' => '',
>> )
>> )
>> )
>>
>> But it always return a validation error, whether there's text in the 
>> textfield or not: 
>>
>> array(
>> 'filename' => array(
>> (int) 0 => 'ruleFilenameEmpty'
>> )
>> )
>>
>> (printed from debug($this->Capture->validationErrors)) 
>>
>> Tested the validation with: 
>>
>> $this->Capture->set($this->request->data);
>> if ($this->Capture->saveAll($this->request->data)) {
>> $this->Session->setFlash('' . __('It 
>> validates') . '');
>> }
>>
>> I had tried all possible names for the validation. None works. 
>>
>> What am I doing wrong here? 
>>
>> Also I would like to validate each set of fields in $this->request->data 
>> before saving. 
>>
>> This is because there are some others to be done after it validates.
>> If the action fails, it should not save.
>> This cannot be done with saveAll(). 
>>
>> How can I evaluate each set of arrays in $this->request->data before 
>> saving?
>>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Diacritic in the validation messages

2012-09-12 Thread euromark
yes
use proper format for your files.
you should save them as utf8 (without bom) if you plan on using those utf8 
chars in them



Am Mittwoch, 12. September 2012 20:39:42 UTC+2 schrieb Petr Juráček:
>
> Hello,
> if I write 'message' => 'aeiou' CakePHP displayed message,
> but if I write 'message' => 'áéíóú' CakePHP not displayed message.
>
> Do you know how to solve it?

-- 
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-12 Thread euromark
why not using the new response class?
http://book.cakephp.org/2.0/en/controllers/request-response.html#cakeresponse
 

since mediaview will be deprecated in 2.3 anyway?


Am Mittwoch, 12. September 2012 06:40:31 UTC+2 schrieb jeet bajaj:
>
> Might be it download() function is looking for the 
> app\views\yourcontroller\download.ctp (view file) and download function 
> don't have that.
>
> try to put $this->autoRender = false; and check what happens.
>
>  function download(){
>>
>  
>
>> * $this->autoRender = false; *
>
>
>> $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;
>>
>>  }
>
>
>
>
>
>
> On Tue, Sep 11, 2012 at 1:23 PM, Yasir Arafat Hasib 
> 
> > wrote:
>
>>
>>
>> On Tue, Sep 11, 2012 at 11:25 AM, Yasir Arafat Hasib 
>> 
>> > wrote:
>> Yes
>>  
>>
>>> Hello
>>>
>>> Check the link i think this will help you
>>>
>>>  
>>> http://arafats.info/cakephp-download-media/
>>>
>>>
>>>
>>> On Tue, Sep 11, 2012 at 8:05 AM, Arie Yuniarto 
>>> 
>>> > wrote:
>>>
 Hi all,

 I wanna ask about create a link to download file.

 so in my view i add this code

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

>>>
>>>
>>>
>>> -- 
>>> *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
>>> 
>>>
>>>  
>>
>>
>> -- 
>> *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
>> 
>>
>>  -- 
>> 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: if statement

2012-09-02 Thread euromark
sry, what you are doing there is just horrible. I cannot find any other 
words for it.
please go through tutorials and the book first
your code is a mess in multiple ways

and it doesnt seem you have understood a single bit of what i wrote. you 
cannot just use those deep arrays in php functions.
no way! and if you properly debug you would notice.

also - besides all that - why retrieving the db data twice or more? using 
find(all) 2x? /:)


Am Sonntag, 2. September 2012 08:04:48 UTC+2 schrieb girl:
>
> Thanks people.
>
> I debug, it returns null :/
> Means something is wrong in code.
>
> Here is my controller:
>
>  class IndexsController extends AppController {
> public $helpers = array('Html', 'Form', 'Session');
> public $components = array('Session');
>
>  public function index() {
>  
> 
> // loading Game model
> $this->loadModel('Game');
> $game = $this->Game->find('all');
> $this->set('games', $this->Game->find('all'));
>  // loading Word model
> $this->loadModel('Word');
> $word = $this->Word->find('all');
> $this->set('words', $this->Word->find('all'));
>  } 
> public function view($id) {
>  // loading Game model
> $this->loadModel('Game');
> $game = $this->Game->find('all');
> $this->set('games', $this->Game->find('all'));
> $dif=$game['Game']['difficulty'];
>  // loading Word model
> $this->loadModel('Word');
> $word = $this->Word->find('all');
> $this->set('words', $this->Word->find('all')); 
> $this->Game->id = $id;
> $this->set('game', $this->Game->read());
>  //variables
> $this->set('rand', rand(1,$this->Word->find('count'))); 
> $this->set('randword', $this->Word->findById(11));
>  //$this->set('word_array', str_split(implode("", 
> $this->Word->findById(11)),1));
> $this->set('word_array', str_split('fight',1));
> $this->set('code', array("*", "*", "*", "*", "*"));
> $code=array("*", "*", "*", "*", "*");
>  for ($i =97; $i<=122; $i++) { 
> $letter .= " href='view.ctp?code=".$code."&var=".chr($i)."&dif=".$dif."'>".chr($i) 
> ."". " "; 
> $this->set('tar', $letter); 
>
>  
>  
> 
> $this->set('popoxakan', $_GET['var']);
> 
>  
>  $position = 0;
> $var_get = $_GET['var'];
> $word = $this->Word->findById(11);
>
> if(in_array($var_get, $word ))
> {
> $position = $this->array_search($var_get,$word);
> }
> $this->set('position', $position );
>
> }
>  
> }   
> }
> ?>
>
>
> And here view
>
>  echo "word= " .$randword['Word']['word']."";
> echo $tar."";
> echo $popoxakan."";
> echo "position= ".$position."";
> ?>
>

-- 
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: if statement

2012-08-31 Thread euromark
you should firstly debug your variables properly
using debug() you would find out that the result returned by 
findBySomething is a deep array (not a flat one)

from there I am certain you will figure it out



Am Freitag, 31. August 2012 11:44:26 UTC+2 schrieb marco metal:
>
> Hi,
>
> It means that either the word you are searching is in first position, 
> that's why  its echoing 0 or (in_array($var_get, $word ) is empty ,meaning 
> $var_get is not inside the array $word.
>
>
>
>
>

-- 
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: Number format in form fields?

2012-08-30 Thread euromark
or attach behaviors like
https://github.com/dereuromark/tools/blob/2.0/Model/Behavior/DecimalInputBehavior.php
 
to do so


Am Donnerstag, 30. August 2012 14:19:59 UTC+2 schrieb Mancho Murgan:
>
> You can modify the $this->request->data formatting the number in 
> controller method with number_format() function.
>
> 2012/8/30 Ingo Siebeck >
>
>> is there any way to get input fields, with decial(10,2) fields behind, 
>> working with other separators? I need the german number format like 
>> 1.000,59 but cake usses 1,000.59
>>
>> by the way, in chrome it's correct.
>>
>> how can I change the settings?
>>
>> thank you.
>>
>> -- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> Murgan, Alexis Germán
> Desarrollador & Diseñador
> Web: german.murgan.com.ar
> Email: ger...@murgan.com.ar 
> MSN: ger...@murgan.com.ar 
> Móvil: +5493424663813
>

-- 
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: Some core code to review

2012-08-24 Thread euromark
I think its some mistake, as well.
its probably best to test the class with the second log key removed and to 
send a pull request on
https://github.com/cakephp/cakephp/pulls 


Am Freitag, 24. August 2012 20:35:28 UTC+2 schrieb cricket:
>
> On Tue, Aug 21, 2012 at 11:56 AM, Juan Ezquerro LLanes 
> > 
> wrote: 
> > Is that a bug? 'log' index is twice? 
> > 
> > File: CAKE/lib/Cake/Utility/Debugger.php line 55 
> > 
> > protected $_templates = array( 
> > 'log' => array( 
> > 'trace' => '{:reference} - {:path}, line {:line}', 
> > 'error' => "{:error} ({:code}): {:description} in [{:file}, line 
> {:line}]" 
> > ), 
> > 'js' => array( 
> > 'error' => '', 
> > 'info' => '', 
> > 'trace' => '{:trace}', 
> > 'code' => '', 
> > 'context' => '', 
> > 'links' => array(), 
> > 'escapeContext' => true, 
> > ), 
> > 'html' => array( 
> > 'trace' => 'Trace 
> > {:trace}', 
> > 'context' => 'Context 
> > {:context}', 
> > 'escapeContext' => true, 
> > ), 
> > 'txt' => array( 
> > 'error' => "{:error}: {:code} :: {:description} on line {:line} of 
> > {:path}\n{:info}", 
> > 'code' => '', 
> > 'info' => '' 
> > ), 
> > 'base' => array( 
> > 'traceLine' => '{:reference} - {:path}, line {:line}', 
> > 'trace' => "Trace:\n{:trace}\n", 
> > 'context' => "Context:\n{:context}\n", 
> > ), 
> > 'log' => array(), 
> > ); 
>
> Perhaps it was done for some debugging reason -- although I can't 
> think of why -- and then forgotten about. If that's the case, maybe it 
> would have been better to comment it out rather than override it 
> temporarily so that it's more noticeable. 
>
> It's weird that PHP allows this, too. 
>

-- 
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: Why do I get console v1.3.2 when I ty to bake app from console on new cakephp v2.2.1 stable version?

2012-08-15 Thread euromark
use relative paths:
http://stackoverflow.com/questions/10499232/cakephp-cake-back-console-app-not-doing-what-i-expect
 


Am Mittwoch, 15. August 2012 22:12:58 UTC+2 schrieb acl68:
>
> -BEGIN PGP SIGNED MESSAGE- 
> Hash: SHA1 
>
> Am 15.08.2012 13:06, schrieb Harshit Sharma: 
> > I am trying to bake app using new stable release of cakephp , but I 
> always 
> > get Welcome to CakePHP v1.3.2 Console .Please help me out? 
> > 
>
>
> Have you both versions on your machine? If yes to which points your cake 
> path? Do you work on a Windows, Ix or Mac? 
>
>
> Anja 
> -BEGIN PGP SIGNATURE- 
> Version: GnuPG v1.4.11 (GNU/Linux) 
>
> iEYEARECAAYFAlAsAskACgkQbOdiIJzHNKFCeACcCJv86njcyuNOg9FK1DiA1Umw 
> LV4AoLeJsNKq9I2XbyxTDKRT0oJiGuUV 
> =bmM4 
> -END PGP SIGNATURE- 
>

-- 
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: invalidFields() returns duplicates?

2012-08-11 Thread euromark
you need to show us some code
but I bet that you call save/validate + invalidate or something like that
it just adds the same message twice to the error message stack


Am Samstag, 11. August 2012 18:26:09 UTC+2 schrieb Shahruk Khan:
>
> array(
> 'email' => array(
> (int) 0 => 'You must enter a proper email address.',
> (int) 1 => 'You must enter a proper email address.'
> )
> )
>
> I get this response when all I have is one field called email in 
> $this->request->data. Any help 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: Help with getting data

2012-08-11 Thread euromark
you do realize that links are to be clicked on?
there are plenty of well written and beautiful colored examples on the link 
I gave you
cheese


Am Samstag, 11. August 2012 11:19:30 UTC+2 schrieb Daren W:
>
> Thanks for the reply, can you give me a example of how I can do this 
> please.
>
>
> On Wednesday, August 8, 2012 2:22:18 PM UTC-4, Daren W wrote:
>>
>> I am in the learning process and would like to know how to write the two 
>> below statements in cake format, could someone please advise.
>>
>> SELECT SUM(credit) - SUM(debit) AS total FROM `bids` AS `Bid` WHERE 
>> `Bid`.`user_id` = 3 LIMIT 1
>>
>>
>> SELECT SUM(bids) AS total FROM `bidbutlers` AS `Bidbutler` LEFT JOIN 
>> `auctions` AS `Auction` ON (`Bidbutler`.`auction_id` = `Auction`.`id`) 
>> WHERE `Auction`.`closed` = 0 AND `Bidbutler`.`user_id` = 3
>>
>> Thanks,
>> Daren
>>
>

-- 
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: PHP Code in Database

2012-08-10 Thread euromark
careful who has access to it, though
using eval can be pretty dangerous - since it can execute any php code.
so "normal users" should probably not have edit access.

PS: in my case it was 
$res = eval("?>" . $str . "



Am Freitag, 10. August 2012 18:24:23 UTC+2 schrieb sanjeev:
>
> Thanks Tilen,
>
> This following code works
> $content = $this->fetch('content');
> echo eval('?>'.$content);
>
> can you explain why i need to prefix ?> berfore $content?
>
> On Fri, Aug 10, 2012 at 3:43 PM, Tilen Majerle 
> 
> > wrote:
>
>> ok, i understand...
>> allow user to write some idk, php code, save it in database and than use 
>> php's eval.
>>
>> http://si2.php.net/manual/en/function.eval.php 
>>
>> eval will execute code :)
>> --
>> Lep pozdrav, Tilen Majerle
>> http://majerle.eu
>>
>>
>>
>> 2012/8/10 Sanjeev Divekar >
>>
>>> No it's not cache. I want to execute user defined PHP code in my view.
>>>
>>>
>>> On Fri, Aug 10, 2012 at 2:31 PM, Tilen Majerle 
>>> 
>>> > wrote:
>>>
 it sound's like you cache some view. Why you don't just use Cache by 
 cakephp ?
 http://book.cakephp.org/2.0/en/core-libraries/caching.html 
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2012/8/10 sanjeev >

> Hello,
>
> I am developing CMS which need to execute some php code e.g.  echo $this->element('helpbox'); ?> which is stored in database.
>
> I tried 
> file_put_contents ('tempfile.tmp',$this->fetch('content'));
> include('tempfile.tmp');
> in layout which works
>
> but any better Idea?
>
> Regards,
>
>
>  -- 
> 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...@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.
  
  

>>>
>>>
>>>
>>> -- 
>>> 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...@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...@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.
>>  
>>  
>>
>
>
>
> -- 
> 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: Fat CakePHP

2012-08-08 Thread euromark
you do realize that you already made as waste our time on this way beyond 
your 6 minutes.. right? :)

to close this chapter for good, ChrisApps is right about the test stuff 
being not necessary for deployment. result: 2MB - done.
that answers the initial question and lets us go back to the real issues at 
hand



Am Mittwoch, 8. August 2012 22:26:22 UTC+2 schrieb ChrisApps:
>
> Yes, and I agree with you. And of course hosting space is not an issue.
> What I was trying to say is: Bandwidth !== HDD space. And that may be an 
> issue.
>
> Let's say that an ordinary person has an upload bandwidth of 2Mbps (Just 
> and ordinary *a*dsl line 50d/2u). That may take up to 6 minutes when 
> uploading a full cake lib to production FTP, that means wait 6 minutes to 
> see if the uploaded thing works.
>
> Yes I know..."who cares...just 6 mins". Well, the thing is that I really 
> hate waste my time on things like that. I prefer to wait 1 minute or less 
> uploading a 2mb package.
> But whatever. Some people like to make coffee in the meanwhile, and some 
> others just doesn't.
>
> Well this is my last comment on this...We are getting out of subject dont 
> you think?
>
> ---
>
> Regards!
> Chris
>
> 2012/8/8 John Hardy >
>
>> Wow, size is a non-issue. You can lease a server instance from rackspace 
>> with 10GB of disk for 15 dollars a month.
>> Tell your clients to forgo their lattes for 3 days or bum change in front 
>> of their office.
>>
>> Do you put plastic covers over your floor mats?
>>
>>
>> On Aug 8, 2012, at 12:43 PM, Christopher Castro 
>> > 
>> wrote:
>>
>> 1- But you're uploading the libs just one time.
>> No that's no true. Only true if all your clients/projects are hosted in a 
>> server managed by yourself.
>>
>> 2- If you have a crappy DSL line just go make some coffee 
>> No, my line is not crappy, it's just an *A*DSL line, probably the same 
>> you use at home. Also I dont like coffe.
>>
>> 3- Hosting package that dings you for a single upload of ~10MB then you 
>> need to find a new provider.
>> Similar to 1. But, I can ride my unicorn and go tell to all my clients 
>> that they must pay a better provider.
>>
>> ---
>>
>> Regards!
>> Chris
>>
>> 2012/8/8 lowpass >
>>
>>> But you're uploading the libs just one time. If you have a crappy DSL 
>>> line just go make some coffee. As for bandwidth, if you have a hosting 
>>> package that dings you for a single upload of ~10MB then you need to find a 
>>> new provider.
>>>
>>>
>>> On Wed, Aug 8, 2012 at 8:29 AM, Christopher Castro 
>>> 
>>> > wrote:
>>>
>>>> Yeah sure, in a perfect world  where unicorns live and clouds are made 
>>>> of sugar... ¬¬
>>>> Bandwidth is not unlimited or free.
>>>> And your common-asymmetric-adsl line can beat your patient, time and 
>>>> money when uploading up to 15Mb to your common-shared-hosting.
>>>>
>>>> ---
>>>>
>>>> I always remove "Cake/Tests|TestSuite/*" and "Cake/Console" from all my 
>>>> production projects to reduces all those inconveniences. With this you can 
>>>> get a 2Mb package (uncompressed)
>>>>
>>>> ---
>>>>
>>>> Regards,
>>>> Chris
>>>>
>>>>
>>>> 2012/8/8 euromark >
>>>>
>>>>> seriously? if you have trouble accepting the fact that webspace is 
>>>>> literally free nowadways (>>>>> 1000 GB), and that the app itself and its 
>>>>> assets (images) will usually cake up 5 times more space in the long 
>>>>> run, you really got your facts wrong.
>>>>> what exactly is the problem with 5-10 MB? Even if the folder would be 
>>>>> 10 times the size - who cares?
>>>>>
>>>>>
>>>>> Am Mittwoch, 8. August 2012 09:14:01 UTC+2 schrieb WyriHaximus:
>>>>>>
>>>>>> Deleting test is my thought exactly if you really want to cut down 
>>>>>> the file size. But I would be more interested why the size is a problem 
>>>>>> in 
>>>>>> the first place?
>>>>>>
>>>>>> On Wed, Aug 8, 2012 at 8:46 AM, Sergei  wrote:
>>>>>>
>>>>>>> Well you can delete Test (5 Mb) folder for sure.
>>>>>>>
>>>>>>> -- 
>>&g

Re: Help with getting data

2012-08-08 Thread euromark
virtual fields are your friend:
http://book.cakephp.org/2.0/en/models/virtual-fields.html 

Am Mittwoch, 8. August 2012 20:22:18 UTC+2 schrieb Daren W:
>
> I am in the learning process and would like to know how to write the two 
> below statements in cake format, could someone please advise.
>
> SELECT SUM(credit) - SUM(debit) AS total FROM `bids` AS `Bid` WHERE 
> `Bid`.`user_id` = 3 LIMIT 1
>
>
> SELECT SUM(bids) AS total FROM `bidbutlers` AS `Bidbutler` LEFT JOIN 
> `auctions` AS `Auction` ON (`Bidbutler`.`auction_id` = `Auction`.`id`) 
> WHERE `Auction`.`closed` = 0 AND `Bidbutler`.`user_id` = 3
>
> Thanks,
> Daren
>

-- 
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: Fat CakePHP

2012-08-08 Thread euromark
seriously? if you have trouble accepting the fact that webspace is 
literally free nowadways (> 1000 GB), and that the app itself and its 
assets (images) will usually cake up 5 times more space in the long 
run, you really got your facts wrong.
what exactly is the problem with 5-10 MB? Even if the folder would be 10 
times the size - who cares?


Am Mittwoch, 8. August 2012 09:14:01 UTC+2 schrieb WyriHaximus:
>
> Deleting test is my thought exactly if you really want to cut down the 
> file size. But I would be more interested why the size is a problem in the 
> first place?
>
> On Wed, Aug 8, 2012 at 8:46 AM, Sergei >wrote:
>
>> Well you can delete Test (5 Mb) folder for sure.
>>
>> -- 
>> Sergei
>>
>>
>> On Tuesday, August 7, 2012 9:20:07 PM UTC+9, sanjeev wrote:
>>>
>>> Hello Everybody,
>>>
>>> I have developed CMS in CakePHP but Size of CakePHP installation is too 
>>> high. Any idea how to stripped-down CakePHP installation (in terms of file 
>>> size)?
>>>
>>> Regards,
>>>
>>  -- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> 
> Website
>  | 
> Blog
>  | Linkedin  | 
> Twitter | 
> Facebook 
>

-- 
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 Email using Shell in CakePHP

2012-08-07 Thread euromark
you should use smtp if you send emails locally. especially if you do not 
know how to set up the environment for sending php mails using mail() etc
its always easier to use the smtp protocol then.
it also has the advantage to always be the same on every environment.


Am Dienstag, 7. August 2012 18:55:22 UTC+2 schrieb cricket:
>
> Does it work if you send the email from a controller? Does it work if 
> you send the email from a normal PHP script? 
>
> On Tue, Aug 7, 2012 at 6:09 AM, NewBie  wrote: 
> >  I write a Shell for sending email like this : 
> > 
> >  > class SendMailShell extends Shell { 
> > function main() { 
> > App::import('Core', array('Controller')); 
> > App::import('Component', array('Email')); 
> > $this->Controller =& new Controller(); 
> > $this->Email =& new EmailComponent(); 
> > $this->Email->startup($this->Controller); 
> > $this->Email->reset(); 
> > $this->Email->to = 'Jonny '; 
> > $this->Email->subject = "Subject"; 
> > $this->Email->from = "jo...@unita.net"; 
> > $this->Email->template = 'default'; 
> > $this->Email->sendAs = "html"; 
> > $this->Email->send(); 
> > } 
> > } 
> > ?> 
> > 
> >  Program execute successfully, but Email do not send to 
> jo...@unita.net. 
> >  I research and do like some guild line in internet but not done. 
> >  Please help 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 
>

-- 
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: Packaging mechanism for CakePHP Plugins ??

2012-08-06 Thread euromark
did you try to search for it?

if I go to the packages site and type in "packages" - what do I get?
http://plugins.cakephp.org/package/josegonzalez/package_installer
 

Am Montag, 6. August 2012 06:33:59 UTC+2 schrieb NdJ:
>
> What is the current state (if any) for the packaging of CakePHP plugins?
>
> We currently have (Plugins listed here http://plugins.cakephp.org/) which 
> is great, but it might be even more awesome if from a cake shell (or 
> similar) you could search for plugins and install (with dependency 
> resolution) new plugins, much the same way as "apt-get" works for Debian, 
> "npm" for Node and "pear" for PHP... etc etc etc.
>
> Seems you might be able to leverage Github pulling tarballs from there 
> (Terms of Service check!!) which then means "all that is required" is some 
> kind of agreeable CakePHP package meta definition file -plus- a central 
> index that can serve responses pointing to Github tarballs.
>
> An example might be:-
> $ cake packages search foobar
>
> Which would send a query to "a suitable host" that stores an index of all 
> registered CakePHP plugins that contain the meta definition file, that host 
> would return information about all packages related to foobar.  So I might 
> then type:-
> $ cake packages install the-foobar-thing
>
> Which in this case would pull the latest "the-foobar-thing" 
> tarball/zipball package from Github, unpack it, parse the meta definition 
> file to determine if there are dependencies and process any installation 
> steps.
>
> Thoughts, comments, problems, solutions, someone else already done or 
> doing this?
>
> N
>
>

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


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


Re: Cakephp 2.x best practice when adding/editing content?

2012-08-03 Thread euromark
for starters, take out the validation redundancy
why setting the errors to the view? also not necessary 
also, in 2.x your __() looks differently (arguments usually are not "true" 
but replacement strings)

why dont you use baking? it would display a better output than you 
currently have



Am Freitag, 3. August 2012 17:43:52 UTC+2 schrieb MetZ:
>
> Yes, I understand what you are doing :) 
> Have a couple of those myself.. 
>
> But my question is (perhaps not clear enough), the best practice for a 
> function like add and edit.
>
> I am thinking about:
> if ($this->request->is('post')) {
> $this->User->set($this->request->data);
> if ($this->User->validates()) {
> 
>
> Those things inside the function. Like,, what approach/setup would you use 
> on cake 2.x to talk with the db and make things happen :)
>
> I am just wondering if I am doing it 100% correct, as I can not find any 
> good tutorials on it anywhere..
>
> Here is my add function as is today, any pointers?
>
> public function admin_add() {
> $this->set('title_for_layout', __('Add new role',true));
> if ($this->request->is('post')) {
> $this->Role->set($this->request->data);
> if ($this->Role->validates()) {
> if ($this->Role->save($this->request->data)) {
> $this->Session->setFlash(__('New role created.',true), 
> 'admin/flash/success');
> $this->redirect(array('action' => 'index'));
> } else {
> $this->Session->setFlash(__('Could not create role, please try 
> again.',true), 'admin/flash/error');
> }
> } else {
> // Didn't validate
> }
> }
> $this->set('errors', $this->Role->validationErrors);
> }
>
> -Tom
>
>
>
> kl. 13:35:30 UTC+2 fredag 3. august 2012 skrev SoulRaven følgende:
>>
>> i use a single method, add/edit even if is user or admin, 
>> the difference between add/edit is that on edit you have the ID set, or in 
>> parameter or in $this->data
>>
>> admin_editpost($id = null){
>>if(is_null($id){
>>//something
>>}
>> }
>>
>> i guess you understand
>>
>> vineri, 3 august 2012, 11:41:01 UTC+3, MetZ a scris:
>>>
>>> Hi all..
>>>
>>> I am in the process of migrate one of my apps fra 1.3 to cakephp 2.x  
>>> and I am wondering, what are the best practices for the new framework?
>>> AND YES, I have read the documents/book :)
>>>
>>> I am just wondering how you do it, so I can compare my work and see if I 
>>> am heading in the right direction with my app.
>>>
>>> So if anyone could give me an idea about a couple simple add/edit 
>>> functions, and how the best practice for this, I would appreciate it :)
>>>
>>> like:
>>>
>>> admin_users_add() {
>>> }
>>>
>>> admin_users_edit() {
>>> }
>>>
>>> and other regular functions you might have an example for.
>>>
>>> Thanks all!
>>> Awesome!
>>>
>>> -Tom
>>>
>>

-- 
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: pagination with lat lng

2012-08-03 Thread euromark
I think you can already use virtualFields for cake1.3
http://book.cakephp.org/1.3/view/1608/Virtual-fields 
then it will work


Am Freitag, 3. August 2012 09:28:56 UTC+2 schrieb lorenzoshake:
>
> $sql_for_distance is the classic function to calculate distance with 
> latlng  

-- 
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: hide model fields from controller

2012-08-01 Thread euromark
it boils down to either
- use security component (form fields cannot be messed with)
- or use whitelisting (fieldList) on save: 
http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-save-array-data-null-boolean-validate-true-array-fieldlist-array


Am Mittwoch, 1. August 2012 11:09:21 UTC+2 schrieb Crazy:
>
> You can use the model callbacks for that, the beforesave one, see:
> http://book.cakephp.org/2.0/en/models/callback-methods.html#beforesave 
>
>
> On Wednesday, August 1, 2012 10:37:29 AM UTC+2, Mahmoud Adel Farid wrote:
>>
>> well i am worried about controller so no other team member can directly 
>> change some fields , i need to encapsulate some fields
>>
>

-- 
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: hide model fields from controller

2012-08-01 Thread euromark
if you can't trust your co-workers, you might want to change the company.
PS: they could still go into the database directly to alter values (or do 
you also cipher the database.php?)

in any case the above hints should get you started on how to address the 
problem.


Am Mittwoch, 1. August 2012 10:37:29 UTC+2 schrieb Mahmoud Adel Farid:
>
> well i am worried about controller so no other team member can directly 
> change some fields , i need to encapsulate some fields
>

-- 
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: hide model fields from controller

2012-07-30 Thread euromark
it is usually not the controller you need to worry about

in the view level just dont output the variable
and on input (forms etc) use whitelisting for the model methods to exclude 
the field on save etc.



Am Montag, 30. Juli 2012 16:34:59 UTC+2 schrieb Mahmoud Adel Farid:
>
> i want any controller not to be able to access(read or write) a certain 
> field in the model
> how can i accomplish that
>

-- 
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: set::sort question

2012-07-30 Thread euromark
a) why not providing the data correctly sorted from the db level? let mysql 
do the work

b) if that is not possible for some reason, why not manually iterating over 
the array? probably still faster than the Set/Hash class anyway.
yeah, might be a few lines more, but at least you got it in a few minutes 
instead of waiting for some guru to write it for you.


Am Montag, 30. Juli 2012 09:05:06 UTC+2 schrieb heohni:
>
> does anyone has an idea?
>
> Am Freitag, 27. Juli 2012 12:36:15 UTC+2 schrieb heohni:
>>
>> Hi,
>>
>> I have this array:
>> Array
>> (
>> [240] => Array
>> (
>> [Member] => Array
>> (
>> [id] => 112
>> )
>>
>> [Payment] => Array
>> (
>> [date] => 0712
>>
>>
>> )
>> )
>>
>> I want to use the set::sort function to sort first for Member.id ASC and 
>> then for Payment.ASC
>>
>> Can please someone explain me how I need to write the set::sort syntax?
>> I never used it before and quite unsure how it has to be done.
>>
>> 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: Numbers cutting off after comma

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


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

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


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


Re: Cake PHP User Management Plugin Eagle

2012-07-28 Thread euromark
can somebody pleeaase stop this spam nonsense?


Am Donnerstag, 26. Juli 2012 20:32:19 UTC+2 schrieb Ivan Suzen:
>
> Hi Guys...
>
> I have purchased User Management Plugin from  
> http://umpremium.ektasoftwares.com/ site. I went through the demo version 
> of so called eagle plugin on http://www.eagle.getyourplugin.com/login. I 
> found that it has been copied from original plugin which is available at  
> http://umpremium.ektasoftwares.com. The original plugin has been launched 
> on 16th April, 2012. So guys before buying this plugin from  
> http://www.eagle.getyourplugin.com/ please go through  
> http://umpremium.ektasoftwares.com/ and you can easily find out  that 
> eagle plugin is pirated version of original plugin. 
>
> Regards,
> Ivan 
>
>
> On Sunday, July 15, 2012 8:21:27 PM UTC+5:30, Steve wrote:
>>
>>
>> hi guys, we have launched an amazing Plugin "Eagle" for Cake PHP. It is 
>> user management Plugin which has 56 features. It also gives you Login with 
>> FB, Twitter, LinkedIn, Foursquare, Google and Yahoo. You can read all its 
>> features here: http://developers.getyourplugin.com/features.html and you 
>> can check the Plugin here: http://www.eagle.getyourplugin.com , you can 
>> test the Plugin on this link: http://www.eagle.getyourplugin.com/login , 
>> default username and password is 123456, check it and tell us the feedback.
>>
>> Regards,
>> Steve
>>
>

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


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


Re: Be Aware of Pirated Copy of CakePhp 2.x User Management Plugin

2012-07-27 Thread euromark
is google groups really becoming the new marketplace for software? really?
there have been quite a few posts now regarding ads to non-free products



Am Freitag, 27. Juli 2012 20:56:54 UTC+2 schrieb Ivan Suzen:
>
> Hi All,
>
> I found the *original website* for CakePhp 2.x User Management Plugin and 
> I would like to share it with you all because I found some *pirated 
> sites*which are selling this plugin. I believe, the real developer of the 
> plugin 
> should get the appreciation and profits  for his plugin.. Don’t you feel 
> that ???
>
> The original website is http://umpremium.ektasoftwares.com. Go through 
> this website once, you will feel that this is the actual website. On this 
> site, you can see *Google Ads* , it means Google has validated this site 
> so it is neither fake nor pirated, it is original site. Even the developer 
> of the plugin  has mentioned his contact details (Email id, Phone no etc)  
> and he is available for 24x7 to help you if you have any issue regarding 
> this plugin. I have purchaged this plugin from this site and I really 
> appreciate the developer and I am really happy with 24x7 support.  I really 
> love his way to solve my problems on time. 
>
> You can get the User Management Plugin Version 1.0 for free on 
> http://usermgmt.ektasoftwares.com/ and User Management Plugin Version 2.0 
> for a very low cost on 
> http://www.ektasoftwares.com/products
> .
>
>
> Please guys be aware of pirated copy of the CakePhp 2.x User Management 
> Plugin and purchase the original plugin from original website.
>
> Thanks,
>
> 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: Autocomplete example for cakephp 2.2

2012-07-25 Thread euromark
Although the description might be german, the example itself should be 
understandable:
http://www.cakephp-forum.de/tutorials-und-snippets/autocomplete-mit-jquery-t1211.html
 


Am Mittwoch, 25. Juli 2012 14:48:37 UTC+2 schrieb Dr. Tarique Sani:
>
> Keep your js separate from the php and any solution will work. 
>
> Tell us what specifically is not working 
>
> Cheers 
> Tarique 
>
> On Wed, Jul 25, 2012 at 6:40 AM, Christopher von Hessert 
>  wrote: 
> > Hi, I'm looking all over google for a way to implement a Autocomplete 
> input 
> > field with no luck. All examples I have found are for cakephp < 1.3 
> > 
> > Does anyone have a working example for cakephp 2.2? 
> > 
> > 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 
>
>
>
> -- 
> = 
> PHP for E-Biz: http://sanisoft.com 
> = 
>

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


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


Re: What security issues do I have to worry about when it comes to CakePHP?

2012-07-23 Thread euromark
using the security component is an absolute requirement for beginners. 
especially due to missing whitelisting in default templates.
besides that you pretty much only need to make sure you don't output 
unescaped output - using h($var)
that should take care of most of the basic problems



Am Montag, 23. Juli 2012 20:04:22 UTC+2 schrieb Shahruk Khan:
>
> I know CakePHP does a lot of stuff for you, but if I setup a CakePHP 
> installation and create a CRUD app, is that it, or do I have to do anything 
> else to make sure the platform is secure?

-- 
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 created/modified to unix time

2012-07-22 Thread euromark
for standards it doesnt matter which country you come from - praise the 
lord.
on a db level this usually only is the one: YY-MM- (for the reasons 
mentioned above)

you are worried about a theoretical - slightly - slower performance with 
the current way of doing things?
write a test case to prove it - with a lot of loops you might actually see 
a difference. But I doubt it will be meaningful.
you will most certainly find out that the performance gain - 
if measurable at all - stands in no comparison to other things in the whole 
framework dispatching process.
meaning: if the whole process needs 1.5 seconds (request till display) and 
you search in the DB takes 0.2 than 0.15 wouldnt make much of a difference.

wrong bottleneck to work on at the moment - just my 5 cents
caching and other more practical things will make more of a difference in 
the long run.



Am Sonntag, 22. Juli 2012 21:36:39 UTC+2 schrieb Alex:
>
> Where are you doing these searches? If in the database I don't think 
>> there would be much of a performance hit. 
>>
>
> The searches are within the database yes, the problem is that "not much of 
> a performance hit" isn't ideal when carrying out a large number of searches.
>  
>
>>
>> You could do a conversion in AppModel::afterFind and add a new key, 
>> 'timestamp' to the data for each record. Or you could even have the 
>> database include it in the results for you, for that matter. 
>>
>
> Converting it after performing the search wouldn't help the performance of 
> the search unfortunately.
>  
>
>>
>> > I realise there may be the excuse that formatting would be required as 
>> unix 
>> > timestamps are unreadable, but this is also the case with the current 
>> setup 
>> > as how many people use -MM-DD HH:MM:SS when displaying dates? it's 
>> > usually DD-MM- or MM-DD-. 
>>
>> No it's not usually those formats. -MM-DD is an ISO standard for 
>> good reason. It sorts naturally, for one thing. Another obvious reason 
>> is right there in your comment: "DD-MM- or MM-DD-" Yes? Which 
>> is it then? They're ambiguous, so should be avoided. 
>>
>
> Sorry by usually I'm referring to US/UK, I have a slight bias :)
>  
>
>>
>> Now, if only some countries would also adopt the metric system. ;-) 
>>
>> > What does everyone else think? 
>> > 
>> > Is there a way to convert the current created/modified fields to UNIX 
>> > timestamps with current CakePHP? 
>>
>> I'll leave it for someone else to say. I know that I have seen where 
>> that is set but cannot remember now. 
>>
>

-- 
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: loadModel () returns empty

2012-07-18 Thread euromark
also - when loading/including a model, why not using the wrapper methods 
cake gives you - for free one should mention


Am Mittwoch, 18. Juli 2012 16:22:16 UTC+2 schrieb AD7six:
>
> You've forgotten to ask a question..
>
> AD
>

-- 
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: Fast alternative to "contains"?

2012-07-17 Thread euromark
@ProLoser

your current version doesnt work for me anymore. seems like 
`$options['fields'] = str_replace($options['class'], $alias, 
$options['fields']);` is killing it:
"Column not found: 1054 Unknown column 'MainMainTag.name' in 'field list'"

removing this line and the tests run again.
are there any tests for it?

here is the version working for me
https://github.com/dereuromark/tools/blob/2.0/Model/Behavior/LinkableBehavior.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 call one function of one contoller into another controller

2012-07-17 Thread euromark
exactly
in short: you don't

most cases you got your coding wrong.
try to put your code into the model, a component, a lib or some other more 
generic class where you can access and call it from
all controller methods you need it.
but including other controllers will only result in a mess in the long run.



Am Dienstag, 17. Juli 2012 08:53:12 UTC+2 schrieb Dr. Tarique Sani:
>
> While you can do what Chetan says - you should not be required to that... 
>
> Consider creating a component if several of your component share the 
> same code OR slight less worse than above create a method in app 
> controller 
>
> HTH 
> Tarique 
>
> On Tue, Jul 17, 2012 at 12:16 PM, Chetan Patel 
>  wrote: 
> > hi 
> > 
> > Please refer below code 
> > 
> > App::import('Controller', 'Posts'); 
> > 
> > $Posts = new PostsController; 
> > 
> > $Posts->constructClasses(); 
> > 
> > 
> > 
> > 
> > 
> > Thanks 
> > Chetan Patel 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Tue, Jul 17, 2012 at 11:57 AM, sneha kulkarni 
> >  wrote: 
> >> 
> >> how i can call one function of one controller into another 
> controller.plz 
> >> 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 
>
>
>
> -- 
> = 
> PHP for E-Biz: http://sanisoft.com 
> = 
>

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


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


Re: NEED HELP

2012-07-16 Thread euromark
how i hate those non-sense for-crying-out-loud thread titles^^

Am Montag, 16. Juli 2012 15:40:06 UTC+2 schrieb Lboogie:
>
> Hello, i am trying to install a project manager created with cake php but 
> can't seem to trigger the install option when there is no install folder or 
> files to do so...can anyone help 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: Database Config

2012-07-14 Thread euromark
use some kind of dynamic db switch to always have the right db setting for 
the corresponding environment
like  http://www.dereuromark.de/2012/02/25/dynamic-database-switching/ 
then your problem resolves itself


Am Sonntag, 15. Juli 2012 00:49:24 UTC+2 schrieb advantage+:
>
> I'm baking local, correct so i need to go into database.php and comment 
> out live config, so i can bake local settings because it wont find the 
> local using live server settings, then uncomment / re comment local 
> settings to upload then re-upload database.
>
> If im making changes to local db its not live, i can bake local and test 
> local without having to always edit the database file.
>
> Like i said no big deal just curious. (using Dreamweaver with Auto Upload 
> on Save) so its a pain in the ass dealing with local and live, i know turn 
> off that setting that's the only reason I asked
>
> :)
>
> On Sat, Jul 14, 2012 at 8:13 PM, euromark wrote:
>
>> for me this doesnt make much sense
>> the database is switched/selected based on the environment not what 
>> action/shell you invoke - normally anyway
>>
>> so for local development you have a local db at all times which will then 
>> also be used for baking
>> or what exactly are you asking? I mean, why switching the local db to a 
>> "more local one" for baking?
>>
>>
>>
>> Am Samstag, 14. Juli 2012 19:35:27 UTC+2 schrieb advantage+:
>>
>>> Is there a way to tell local cake what database to use when baking? So 
>>> for example when baking use $local config
>>>
>>>  
>>>
>>> public $default = array(
>>>
>>>   **  'datasource' => 'Database/Mysql',
>>>
>>>   **  'persistent' => false,
>>>
>>>   **  'host' => 'localhost',
>>>
>>>   **  'login' => top_secret',
>>>
>>>   **  'password' => 'hard_to_guess',
>>>
>>>   **  'database' => 'storage_locker',
>>>
>>> );
>>>
>>> 
>>>
>>> public $local = array(
>>>
>>>   **  'datasource' => 'Database/Mysql',
>>>
>>>   **  'persistent' => false,
>>>
>>>   **  'host' => 'localhost',
>>>
>>>   **  'login' => 'root',
>>>
>>>   **  'password' => '',
>>>
>>>   **  'database' => 'local_site',
>>>
>>> );
>>>
>>>  
>>>
>>> Not a super important question , just curious?
>>>
>>  -- 
>> 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: Database Config

2012-07-14 Thread euromark
for me this doesnt make much sense
the database is switched/selected based on the environment not what 
action/shell you invoke - normally anyway

so for local development you have a local db at all times which will then 
also be used for baking
or what exactly are you asking? I mean, why switching the local db to a 
"more local one" for baking?



Am Samstag, 14. Juli 2012 19:35:27 UTC+2 schrieb advantage+:
>
> Is there a way to tell local cake what database to use when baking? So for 
> example when baking use $local config
>
>  
>
> public $default = array(
>
> 'datasource' => 'Database/Mysql',
>
> 'persistent' => false,
>
> 'host' => 'localhost',
>
> 'login' => top_secret',
>
> 'password' => 'hard_to_guess',
>
> 'database' => 'storage_locker',
>
> );
>
> 
>
> public $local = array(
>
> 'datasource' => 'Database/Mysql',
>
> 'persistent' => false,
>
> 'host' => 'localhost',
>
> 'login' => 'root',
>
> 'password' => '',
>
> 'database' => 'local_site',
>
> );
>
>  
>
> Not a super important question , just curious?
>

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

2012-07-11 Thread euromark
Yummy - love it :)


Am Mittwoch, 11. Juli 2012 12:37:35 UTC+2 schrieb Graham Weldon:
>
>  Sure. 
>
> You just need:
> - FlourJS,
> - SugarCRM
> - Phocoa (Like Cocoa, for PHP)
> - PHPEgg
> - Mozilla Butter (For Popcorn)
>
> If this is not rich enough for you, try adding some "Chocolate Chip UI".
>
> Hope that helps.
>
> Cheers,
> Graham Weldon
> http://grahamweldon.com
> e. gra...@grahamweldon.com
> p. (+61) 0407 017 293
> Skype: grahamweldon
>
> On Wednesday, 11 July 2012 at 11:53 AM, Marsson C. wrote:
>
> Hi,
>
>
>Can I edit rich content with BrowniePHP ?
>
>   I mean like if I had a CKEditor ?
>
>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


Re: No cases in url parameters ?

2012-07-08 Thread euromark
why not using utf8_unicode_ci (ci stands for case ins.)?
using this for all tables will take care of your poblem at the root 
(without having to change fields)


Am Sonntag, 8. Juli 2012 11:48:21 UTC+2 schrieb JonStark:
>
> Oh thanks never knew about this ! Do you know how to edit a table field 
> with phpMYAdmin to allow case sensitivity ?
>
> Thanks !
>
> Le dimanche 8 juillet 2012 02:16:09 UTC+2, JonStark a écrit :
>>
>> Hi !
>>
>> I have an app where user profiles can be found thanks to their username 
>> or hash as parameter :
>>
>> public function view($username) { 
>>> $user = $this->User->find('first', array(
>>>  'conditions' => array(
>>>  "or" => array(
>>>  'User.hash' => $username,
>>>  'User.username' => $username
>>>  )
>>>  ),
>>> ));
>>>
>>
>>> $this->set(compact('user')); 
>>
>> 
>>> }
>>
>>
>> This allows me to find an user with both :
>>
>> app.com/users/view/username or
>> app.com/users/view/xdedweZDE654
>>
>> The problem is that I found that if a user is for example USERNAME, if a 
>> second user is named UserName, the url app.com/users/view/UserName it 
>> will still display USERNAME profile... Is there a way to force cake to take 
>> into account parameter cases ?
>>
>> Thanks a lot !
>>
>

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


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


Re: Cakephp with barcode

2012-07-05 Thread euromark
Well, you see
there are quite a few ways to produce barcodes (see google for reference)
those PHP libraries can easily be used from cakephp to display barcodes

the other way around is more difficult. you would need hardware to actually 
read and process barcodes.
a cellphone with a barcode reader app would do the trick which then calls 
or redirects to an url like
/mysite/code/123456
but without actual code or what do tried so far the answer will be as broad 
as your question.

Best Regard
Mr. Developer



Am Donnerstag, 5. Juli 2012 18:13:36 UTC+2 schrieb Mr. Manager:
>
> Dear All,
>
> If everyone know the solution to deal with my issue is that I would like 
> to build an application that manage product with cakephp and also use with 
> barcode, the requirement is that I want to generate barcode for products 
> with respect to their id and also read barcode from barcode scanner and 
> process in the application to show data of the product and calculate the 
> price for invoicing.
>
> I am looking forward to hearing good news from all of you as soon as 
> possible.
>
> Best Regard,
> Mr. Manager,
>

-- 
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: CakeDC Search plugin for CakePhp 2.0, multiple models

2012-06-15 Thread euromark
try this one:
https://github.com/dereuromark/search 

it can handle multiple fields across models for a like term etc

'field' => array('Primary.field', 'Secondary.other_field')


Am Freitag, 15. Juni 2012 00:06:03 UTC+2 schrieb Bob Bowen:
>
> Is there any way to make this work? As I understand it you have to 
> enable Search.Searchable in the $actsAs, and define $filterArgs for each 
> Model, then add Search.Prg to $components and define $presetVars in the 
> Controller.
>
> Then in your .ctp file you put something like this:
>
> echo $this->Form->create('MyModel', array('url' => 
> array_merge(array('action' => 'find'), $this->params['pass'])));
> echo $this->Form->input('search', array('div' => false));
> echo $this->Form->submit(__('Search', true), array('div' => false));
> echo $this->Form->end();
>
> But this allows you to search in one Model at a time. Is there any way to 
> define a search form with one search field and have it look in various 
> fields within various Models?
>
> Thanks
> Bob
>

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


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


Re: Cakephp Benchmark with debug is 2 and 0

2012-05-31 Thread euromark
NO, i am saying that this shoudn't have been in this blog post in the first 
place
it is absolute nonsense to say that this a performance gain - since debug 0 
is the absolute requirement for any (live) app
therefore there is nothing to compare

you develop with 2, you deploy with 0
2 will always be slower (due to more debug stuff) - and no one actually 
cares how much slower since only the productive one matters

you see that there is no point in doing that?



Am Donnerstag, 31. Mai 2012 16:22:01 UTC+2 schrieb Điển vũ:
>
> I  used ab apache's benchmark , command line: ab -k -n 100 http://b/ . 
> please read this :
>
> https://gist.github.com/51757a95763fd8ac7b53 
>
> It seems debug 0 is litle faster compare with debug 2. But i remember in 
> previous version debug 0 is a lot faster . 
>
>

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


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


Re: Cakephp Benchmark with debug is 2 and 0

2012-05-31 Thread euromark
you cannot compare debug mode 2 and 0
thats nonsense and like comparing cars to screws


Am Donnerstag, 31. Mai 2012 12:47:46 UTC+2 schrieb Điển vũ:
>
> I still think with debug is 0 , cakephp will be run faster when debug is 
> 2. 
> But when i use ApacheBench : ab -n 100 http://example.com in localhost . 
> It showed results is same.
> I ever read this article: 8 ways to speed up 
> Cakephp from 
> long time ago when cakephp 1.3
> Did cakephp 2.0 improved performance  ? 
>

-- 
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: Reporting in cake php

2012-05-30 Thread euromark
try  https://github.com/ceeram/CakePdf 

Am Mittwoch, 30. Mai 2012 10:48:06 UTC+2 schrieb AD7six:
>
>
>
> On Wednesday, 30 May 2012 08:02:40 UTC+2, DAHAN Mamdouh wrote:
>>
>> Hello
>> I want to generate pdf reporting with cake php, please advise me
>>
>
> Start from: it's exactly the same as generating a pdf with php.
>
> AD
>

-- 
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 I can edit a user without changing the password?

2012-05-29 Thread euromark
a) by attaching the behavior in different ways (with different settings) 
for each action you can have the desired results
I think it was "allowEmpty" => false for add forms

b) you can't (and never should either) - due to the nature of how hashing 
works



Am Dienstag, 29. Mai 2012 20:57:49 UTC+2 schrieb lsri8088:
>
> Thanks euromak.
>
> I like the solution to check if it is empty but ... How do I distinguish 
> between "add action" and "edit action"?
> If I add a new user the password should be mandatory.
> If I edit the user then the password is blank if not modified.
>
> Another thing  How can see the current value of the field in database? 
> For example
>
> function beforeSave(){
>  if(empty($this->data[$this->alias]['password']))
> $this->data[$this->alias]['password'] = currentPassword;  // 
> hash password stored in data base
>  else
> $this->data[$this->alias]['password'] = 
> AuthComponent::password($this->data[$this->alias]['password']);
>
> return true;
> }
>
> 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: Extend model/datasource to save user_id on create, update

2012-05-29 Thread euromark
you are probably looking for some "WhoDidItBehavior"
https://github.com/dereuromark/tools/blob/2.0/Model/Behavior/WhoDidItBehavior.php
 


Am Dienstag, 29. Mai 2012 15:23:39 UTC+2 schrieb GB:
>
> We believe it is important to save the user id with a record both on 
> create and update to know who created/changed it.  So if table has columns 
> 'create_user_id' and 'update_user_id', they would get populated with the 
> user_id of who is logged in on create/update, just like the 
> 'created'/'updated' timestamps automagically get set on create/update.
>
> I recall seeing this long ago but cannot find in any archives.  Can anyone 
> point me to resources on how to do this?  I suspect it means extending the 
> model in AppModel but wasn't sure if more appropriate extending the 
> Datasource.
>
> Thanks!
>
> George
>

-- 
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 I can edit a user without changing the password?

2012-05-29 Thread euromark
use this when displaying pwd fields:
http://www.dereuromark.de/2011/08/25/working-with-passwords-in-cakephp/


Am Montag, 28. Mai 2012 22:00:22 UTC+2 schrieb Richard:
>
> I am sure there are a lot better solutions than this, and more brilliant 
> coders can help you out, but at least this is what I did.
>
> I used password and password2 (or reEnterPassword however your call it) on 
> edit.ctp
> and use two different rules from the User model
>
> on Model, you will need public $validation as your default rule,
> then create public $validationSets (you need a plugin for this.  I think 
> it is multivalidate)
> and you would create validation something like
>
> public $validationSets = array(
>
> 'edit' => array(
>
> YOU DO ADD PASSWORD SECTION HERE
>
> },
> 'add' => array(
>
> whatever rule you want
>
> },
> 'editWithOutPassword' => array(
>
> Rules WITHOUT PASSWORD HERE
>
> )
>
> );
>
>
> Then on UsersController.php, you would call it something like
>
> public function edit($id = null) {
>
> if edit with password {
>
> $this->User->setValidation('edit');
> and do whatever your code here
>
> } else {
>
> $this->User->setValidation('editWithOutPassword');
>
> And here, you will have to compile your own list of forms you need to save 
> without password.
> something like
> $fieldsToUpdate = array(your field list here);
> $formValues = array(your form values here);
> $this->User->read($fieldsToUpdate, $id);
> $this->User->set($formValues);
>
> and rest of your save code here
> if($this->User->save()) {
>
> User has been saved
>
> } else {
>
> User could not be saved.
>
> }
>
> }
>
> }
>
> On Mon, May 28, 2012 at 12:20 PM, lsri8088  wrote:
>
>> Hello,
>>
>> I'm using cake 2.1 with AuthComponent and standard data modelusers.
>>
>> How I can edit a user without changing the password?
>>
>> For example, add a check "I want to change the password." If thischeck is 
>> true then I make a hash of the password and keep it inserted.Otherwise I 
>> do not modify the password field.
>> How do I add this check and then check it in my beforeSave() function?
>>
>> Another option I can think of is to leave the password field empty when 
>> I go to edit a user (unset ($ this-> request-> data ['User'] ['password']) 
>> ;)and then check if the password is empty or not. But  when I insert a 
>> new user the password field should be mandatory 
>>
>> Do you have any ideas?
>>
>> 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
>>
>
>
>
> -- 
> Richard Joo
>
>  

-- 
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: GoogleMapV3 Helper issue

2012-05-26 Thread euromark
without showing the complete code its hard to tell what you are doing wrong

no - as long as you are connected to the internet you should be fine


Am Freitag, 25. Mai 2012 21:24:57 UTC+2 schrieb Michael:
>
> Would there be any issue with the fact that I am running it from my 
> local host instead of from my host? 
>

-- 
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: GoogleMapV3 Helper issue

2012-05-25 Thread euromark
you must be doing sth wrong. this is usually a JS error.
if you use firefox and firebug extension you most likely can see the JS 
error in the firebug console at the bottom.


Am Freitag, 25. Mai 2012 09:56:06 UTC+2 schrieb Michael:
>
> So I have been trying to get this to work but still cannot seem to 
> work through it. 
>
> I am using this version: 
> https://github.com/dereuromark/cakephp-google-map-v3-helper 
>
> And following this explanation: 
>
> http://stackoverflow.com/questions/8795104/google-map-v3-cakephp-helper-and-multiple-markers
>  
>
> But I cannot seem to get it to show up and all I get when I try to 
> display the map is "Map cannot be displayed!" 
> I have turned off all my css in hopes that would solve it, but no 
> luck. I am running Cake 2.1 and trying to get this working on my 
> localhost, which is connected to the internet. Any help would be most 
> welcome. Thanks in advance. 
>
> ~Michael 
>

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


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


Re: cakephp 2 tinyint(1) return as boolean changes

2012-05-24 Thread euromark
just use casting for this and you will be fine:

echo (int)$car['Car']['is_active']; 




Am Donnerstag, 24. Mai 2012 10:55:57 UTC+2 schrieb Andras Kende:
>
> in cake 1.3 always used tinyint(1) for is_active database fields..
>
> echo $this->Form->input('is_active');
> this created a checkbox and saves 0 or 1 into the database.
>
> Then i could use this 0/1 very conveniently :
>
> 
>
> find('all', array('codititons' => array('Car.is_active' => 0)))
>
>
> With cakephp 2 its no longer returns as 0 :
> db : 0 = [is_active] => 1 ; ["is_active"]=> bool(true)
> db : 1 = [is_active] => ; ["is_active"]=> bool(false)
>
> Cake 2.0  
> http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html
> Boolean column values will be casted to php native boolean type 
> automatically,  
> so make sure you update your test cases and code if you were expecting the 
> returned value to be a string or an integer: If you had a “published” 
> column 
> in the past using mysql all values returned from a find would be numeric 
> in the past,
> now they are strict boolean values.
>
> For now I set :
> form helper manually to : echo $this->Form->checkbox('is_active'); 
> and db is_active field to :  int(1).
>
> Could you confirm if this is the recommended way to handle 0/1 values in 
> cakephp 2.x ?
>
>
>
>
> Thanks,
>
> Andras Kende
>
>

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

2012-05-23 Thread euromark
I still use google maps.
but there the only evolution is going to "not free anymore" - so for high 
traffic sites this might not be the most suitable approach (or it might 
again if the money is not the issue).


Am Mittwoch, 23. Mai 2012 19:53:07 UTC+2 schrieb Alex Bovey:
>
> Hi all,
>
> What behavior / component / plugin is everyone using for geocoding these 
> days?
>
> I want to use either Yahoo or Google Maps and I've found a bakery article 
> from Nate in 2007 but can't find the actual behavior anywhere:
>
> http://bakery.cakephp.org/articles/nate/2007/04/13/geocoding-in-cakephp
>
> As that was 5 years ago I guess there might be a more evolved solution now 
> anyway?
>
> THanks,
>
> Alex
>
> -- 
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65
> a...@bovey.co.uk | t 0844 567 8995 | m 07828 649386 | f 0870 288 9533
> PHP | CakePHP | MySQL | jQuery | HTML5 | CSS3 | Drupal | Wordpress
>
>  

-- 
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: i need changepassword validations in cakephp

2012-05-23 Thread euromark
use a behavior 
like www.dereuromark.de/2011/08/25/working-with-passwords-in-cakephp/


Am Mittwoch, 23. Mai 2012 16:23:23 UTC+2 schrieb Hill180:
>
> Are you talking about complexity rules?
>
>
>
> On Wed, May 23, 2012 at 2:59 AM, Roopa Mani C wrote:
>
>> i need changepassword validations in cakephp
>>
>> --
>> 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: adding a search function

2012-05-22 Thread euromark
try https://github.com/cakedc/search

Am Dienstag, 22. Mai 2012 19:35:29 UTC+2 schrieb webguy262:
>
> How do I add a search function to an existing CakePHP site I inherited?

-- 
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: shell class Hello could not be found,what's the problem?

2012-05-20 Thread euromark
dont you just love double posts, AD?
the answer has already been given a day ago:
http://stackoverflow.com/questions/10671634/cakephp-shell-shell-class-helloshell-could-not-be-found
 

^^ but what the heck. let them keep us busy anyway


Am Sonntag, 20. Mai 2012 09:28:31 UTC+2 schrieb LiveJin:
>
> Dear everyone: 
> I am a newer to cakephp .I config the cakephp shell as the cakephp 
> handbook says,when I run the HelloShell  with the command cake 
> Hello ,I got the error information as follows: 
>
> Error: Shell class HelloShell could not be found. 
> #0 G:\htdocs\cakedemo\lib\Cake\Console\ShellDispatcher.php(191): 
> ShellDispatcher 
> ->_getShell('hello') 
> #1 G:\htdocs\cakedemo\lib\Cake\Console\ShellDispatcher.php(69): 
> ShellDispatcher- 
> >dispatch() 
> #2 G:\htdocs\cakedemo\app\Console\cake.php(33): 
> ShellDispatcher::run(Array) 
> #3 {main} 
>
> my cakephp version : 
> Welcome to CakePHP v2.2.0-beta Console 
> --- 
> App : Console 
> Path: G:\htdocs\cakedemo\app\Console\ 
> --- 
> anyone who is helpful can give me a advice,plea.

-- 
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: upload image by encoding it in base64

2012-05-17 Thread euromark
why are you decoding again?
if you want the image to be displayed as base64 you need to display it 
encoded all the way

PS: you should also think about making a convenience method for this like I 
once did:
https://github.com/dereuromark/tools/blob/2.0/Lib/MyHelper.php#L70 
so that you can access it just like

echo $this->Html->imageFromBlob($this->data['Card']['photo']);


Am Donnerstag, 17. Mai 2012 12:54:16 UTC+2 schrieb Mangesh Sathe:
>
> Hello all ,
>
>  I am new to cakephp.  I am using cake 1.3 .
>  i want to upload image by encoding it in base64.
>
>  here is my image code in  view  
>   form is enctype multipart encoded 
>
>   Form->file('photo', array('id' => 
> 'fileField','label'=>false)); ?>
>
>  here is my base64 encode in  controller
>   
>  
>   $photo = base64_encode($this->data['Card']['photo']);
>   echo $photo;
>
> i am using this code on another view
>  width="25" height="24" />
>
> It is not getting encoded in base64.
>
> Thanks in advance.
>
>
>

-- 
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: Form->month error

2012-05-08 Thread euromark
i think the docs are outdated in this case.
there are only 2 arguments in 2.x
see the class itself for details.
(any decent IDE would have pointed that out to you directly, though)


Am Dienstag, 8. Mai 2012 18:46:41 UTC+2 schrieb hoss7:
>
> hi
>
>
> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::month
>
> i have run this line
>
> echo $this->Form->month('mob', null, array('monthNames' => false));
>
> and i see this error:*Fatal error*: Unsupported operand types in *
> lib\Cake\View\Helper\FormHelper.php* on line *1990* 
> note: i have cakephp 2.1.2
>

-- 
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: different find results for models null values.

2012-05-08 Thread euromark
you can usually find the latter in belongsTo relations.
cake will then return the result with those values set to null.

if you have hasMany relations (a separate query) it doesnt make sense to 
return lots of empty result sets
and therefore it would just be an empty array


Am Dienstag, 8. Mai 2012 18:55:10 UTC+2 schrieb Michael:
>
> So sometimes the results for my model finds seem to very between the 
> two formats: 
>
> $results['Faction'] = array() 
>
> and 
>
> $results['Faction'] = array('id'=>null, 'name'=>null) 
>
>
> What determines the two? I would prefer that it always give me the 
> listed fields with null values, but I am unsure what is going on to 
> give that. I am toying around with the idea of having a function put 
> into the afterFind() that would add the missing data if needed but it 
> seems a bit clunky.  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: Wrong request method (2.1.2)

2012-05-05 Thread euromark
thats why I don't care about PUT or POST:
https://github.com/dereuromark/tools/blob/2.0/Controller/Component/CommonComponent.php#L143
 

for me:
posted = put or post
get otherwise

at least in a practical sense anyway (since the one is only a more specific 
version of the other).


Am Samstag, 5. Mai 2012 08:10:43 UTC+2 schrieb Jimit Kapadya:
>
> Which book is best in CakePhp..
>
> On Sat, May 5, 2012 at 9:41 AM, Miles J  wrote:
>
>> I believe it has changed so if you are doing an edit it sends a PUT, else 
>> if you are doing a create it sends a POST.
>>
>> I ran into that same issue today.
>>
>>
>> On Friday, May 4, 2012 1:17:31 PM UTC-7, SigalX wrote:
>>>
>>> I've seen that cake had sent "PUT" in the "_method" variable but it was 
>>> POST and I got "PUT" from $this->request->method() in the controller as 
>>> well. How to get truly request method via cake?
>>
>>  -- 
>> 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 get id before saving

2012-05-03 Thread euromark
the id is unknown on add.
therefore you should have a afterSave() hook for this

public function afterSave($created) {
if (!$created) return;
$this->saveField('personalno', $this->id + 100);
}

or sth like that should work


Am Donnerstag, 3. Mai 2012 12:02:00 UTC+2 schrieb alexkd:
>
> I am using cake1.3 
> I have a table patient with id(primary key),personalno fields. 
> I have to set personalno=id+100. 
> That is before saving, personalno have to id+100. How can i get the id 
> value beforesaving or aftersaving. If aftersaving then how can i edit 
> table  with single or more code. 
>
> 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: $this->Params['controller'] doesn't work in cakephp component

2012-05-02 Thread euromark
@romel
first error: he wants it in a component - not the view

second issue: the request object should be used for this. not the 
controller itself (that used to be this way in 1.x)
http://book.cakephp.org/2.0/en/controllers/request-response.html#cakerequest
 
(as for right now it still works (readonly) but might be deprecated in 
later versions anyway)

but - concerning the view - why passing it on to the view manually? the 
view also has the request object and therefore this information
and last error: beforeFilter is only triggered on valid request. so it 
might break. always use beforeRender() for passing stuff like that to the 
view
but since its irrelevant to this thread..


Am Mittwoch, 2. Mai 2012 13:44:51 UTC+2 schrieb romel javier gomez herrera:
>
> hi! 
>
> if the version of cakephp is 2.1 
>  // in /app/Controller/AppController.php 
>  public function beforeFilter(){
>  $this->set('controller',$this->params['controller']);
> $this->set('action',$this->params['action']); 
>   
>  }
>   // in /app/View/Latyouts/default.ctp 
>  echo 'Controller: '.$controller.'Controller.php'.'';
>  echo 'View: '.$action.'.ctp';
>
>
>
> 2012/5/2 Tilen Majerle 
>
>> in your __construct() method for component, first parameter is 
>> ComponentCollection $collection object.
>> From here you can store controller to component like
>> $this->Controller = $collection->getController();
>>
>> then params you have in $this->Controller->params
>> --
>> Lep pozdrav, Tilen Majerle
>> http://majerle.eu
>>
>>
>>
>> 2012/5/2 Cruisine 
>>
>>> hi guys...i need to know how to get current controller from cakephp
>>> component
>>> i tried to use $this->Params['controller'] on my component but it
>>> keeping me get error message like this :
>>>
>>> Notice (8): Undefined property: DynRubrikComponent::$params [APP
>>> \controllers\components\dyn_rubrik.php, line 17]
>>>
>>> do u guys know how to deal with this matter ? need ur help very
>>> soon...thank u..
>>>
>>> --
>>> 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: cookie and array

2012-05-01 Thread euromark
as I explained above you need to cast such a return result before you can 
use it as an array.

$arr = (array)$this->Cookie->read('braceletid');
$arr[] = $id;
$this->Cookie->write('braceletid', $arr);
 

Am Dienstag, 1. Mai 2012 11:59:07 UTC+2 schrieb hoss7:
>
> thanks, how can i add some value in this array in cookie?
>

-- 
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: cookie and array

2012-05-01 Thread euromark
you just rephrased your initial post.
and still didnt post the actual code of your problem (only pseudo code 
which you shouldnt)

also - always cast if you want to to check some key that might be null.

$cookieArray = (array)$this->Cookie->read('key');
if (in_array($value, $cookieArray)) {}


Am Dienstag, 1. Mai 2012 11:42:08 UTC+2 schrieb hoss7:
>
> i want create some cookie for add some array in it and i want add some 
> value in this array and update cookie
>
> in cookie i want have this:
> array()
> then
> array([0]=>1)
> then
> array([0]=>1,[1]=>2)
> then
> array([0]=>1,[1]=>2...)
>
> this is my problem
> if (in_array(1,cookie array){
> echo 'yes';
> }
>
> i want have some array in cookie and check some value,this value is 
> product.id and array values is all product.id have user view it,i want 
> chek user only see  this product one time
>

-- 
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: cookie and array

2012-05-01 Thread euromark
so what exactly is your problem?
what happens?

from the idea you display it should work just fine
but without actual code we cannot see what you are doing there and why it 
might have been broken



Am Dienstag, 1. Mai 2012 08:26:44 UTC+2 schrieb hoss7:
>
> hi
>  i want send array to some cookie and then i want push some values to this 
> array in cookie.
> for example:
> in cookie i have this:
> array()
> then
> array([0]=>1)
> then
> array([0]=>1,[1]=>2)
> then
> array([0]=>1,[1]=>2...)
>
> this is my code:
>
> $arr=$this->Cookie->read('braceletid');
> array_push($arr,$id);
> $this->Cookie->write('braceletid', $arr);
>
> pr($this->Cookie->read('braceletid'));
>
> i want use this array like this.
>
> example:
>
> if (in_array(1,cookie array){
> echo 'yes';
> }
>

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

2012-04-25 Thread euromark
what version are you using?
because in 2.x it should be the other way around:

sort($key, $title)

please always mention your cake version



Am Donnerstag, 26. April 2012 01:29:26 UTC+2 schrieb Hill180:
>
> Trying to use the paginator in the view
>
> I have an Author who is has a Book and where the "book" was written (
> book_id.name, city_id.name) 
> Author sort works, title sort work, but not the sort for city_id. I can 
> sort by the id, but obviously this won't work because 
> the id has nothing to do with the name of the city.
>
>
>
> Paginator->sort('Author', 'name'); ?> 
>  Paginator->sort('Book', 'title.name'); ?> 
>  Paginator->sort('Where Written', 'title.city_id'); 
> ?> (sorts, but the names are not sorted because
> it is using the id)
>
> need something like this
> Paginator->sort('Where Written', 'title.city_id.name
> '); ?> //does not work.
>
> Is there a way to get this to work, or is it a customer pagination?
>
> thanks..  
> j
>

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


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


Re: 2.1.x API

2012-04-25 Thread euromark
its all in the documentation:

http://book.cakephp.org/2.0/en/views.html 
and
http://book.cakephp.org/2.0/en/views.html#view-blocks 

note the "New in version 2.1." label



Am Mittwoch, 25. April 2012 14:54:02 UTC+2 schrieb Mohammad Naghavi:
>
> Hi all, 
> today I downloaded the CakePHP 2.1.1 for the first time and started a new 
> project with it, what I just saw at first look at the default layout source 
> was $this->fetch(..) commands that I have not seen in CakePHP 1.x or 2.0, 
> so I wanted to look it up in API but it was very interesting that the 
> http://api20.cakephp.org does not contain any description for this 
> method, not in View class and not any where else. Now I wanted to ask if 
> the API has to be updated to contain this and any other methods of 2.1 
> version or am I missing something which is preventing me from finding this 
> method in API?
>
> thanks in advance,
> 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


Re: Too many redirects when login-user access the control they don't allow to go

2012-04-25 Thread euromark
yeah
but my proposal about correcting this redirect hasnt been applied right at 
the beginning of 2.0 as far as I know

still, I think the main issue might be solvable by debugging the redirects

>

-- 
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: Too many redirects when login-user access the control they don't allow to go

2012-04-24 Thread euromark
from the look at your code I can see nothing wrong so far
try to debug redirect() and find out what it tries to redirect to - e.g. 
using $this->log() 

maybe you are using an early cake version where you would get redirected to 
the homepage (/) instead of your loginRedirect in such a case.
if this url then isnt public or redirecfts you back to the referer you 
might run into such an endlessloop.
hard to say from the above code pieces


Am Dienstag, 24. April 2012 23:20:06 UTC+2 schrieb Budd:
>
> What is the best way to do it? 
>
> I am just making a simple website with login. 
>
> People need to login to see the data and they only can see the login 
> page if they are not login. 
>
>

-- 
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: Too many redirects when login-user access the control they don't allow to go

2012-04-24 Thread euromark
@cricket: but it shouldn't hurt either :)


Am Dienstag, 24. April 2012 22:37:03 UTC+2 schrieb cricket:
>
> The login method is special and shouldn't be included in allow(). 
>
> On Tue, Apr 24, 2012 at 4:22 PM, Budd  wrote: 
> > public function login() { 
> > if ($this->request->is('post')) { 
> > if ($this->Auth->login()) { 
> > $this->Session->setFlash(__('Login Success')); 
> > $this->redirect($this->Auth->redirect()); 
> > } else { 
> > $this->Session->setFlash(__('Invalid username or password, 
> > try again')); 
> > } 
> > } 
> > } 
> > 
> > 
> > If no login, nobody can access login page, no? 
> > 
> > 
> > 
> > On Apr 24, 2:57 pm, lowpass  wrote: 
> >> > $this->Auth->allow(array('login','logout')); 
> >> 
> >> Don't include login here. 
> >> 
> >> Also, do you have a login() method? If so, post that. 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> On Tue, Apr 24, 2012 at 10:52 AM, Budd  wrote: 
> >> > Hi, 
> >> 
> >> > I have setup ACL component and everything looks fine. But only one 
> >> > problem. 
> >> 
> >> > If i am not login and access some permission denied page, it will 
> >> > redirect me to login page 
> >> 
> >> > If i am login to basic user and access some permission denied page, 
> it 
> >> > will show up the error page "Too many redirects". 
> >> 
> >> > I don't know which path it was point to and keep looping, any way to 
> >> > show it? 
> >> 
> >> > I added this to my app controller 
> >> 
> >> >$this->Auth->loginError = "Wrong credentials. Please provide a 
> >> > valid username and password."; 
> >> >$this->Auth->authError = "You don't have sufficient privilege 
> >> > to access this resource."; 
> >> >$this->Auth->loginAction = array('controller' => 'users', 
> >> > 'action' => 'login'); 
> >> >$this->Auth->logoutRedirect = array('controller' => 'users', 
> >> > 'action' => 'login'); 
> >> >$this->Auth->loginRedirect = array('controller' => 
> >> > 'adcontents', 'action' => 'index'); 
> >> 
> >> > The users controller i added: 
> >> > function beforeFilter() { 
> >> >parent::beforeFilter(); 
> >> >$this->Auth->allow(array('login','logout')); 
> >> > } 
> >> 
> >> > I don't know how i can fix this problem as i didn't redirect to 
> >> > somewhere else. It is only happen when i login to basic user not 
> >> > public user. 
> >> 
> >> > I already spent couple of hours to figure it out. But i have still no 
> >> > cue 
> >> 
> >> > Thank you. 
> >> 
> >> > -- 
> >> > Our newest site for the community: CakePHP Video Tutorialshttp://
> tv.cakephp.org 
> >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 
> 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 athttp://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: issues with FormHelper

2012-04-24 Thread euromark
"Why create the FormHelper an additional hidden input field?!?!?!"
there is nothing wrong.
the answer can be found here:  
http://stackoverflow.com/questions/10049917/cakephp-checkbox-is-showing-extra-hidden-field/10049937#10049937
 



Am Dienstag, 24. April 2012 14:48:07 UTC+2 schrieb Sipatshi:
>
>
> hi,
>
> Controller:
> class ConfigurationsController extends AppController {
> 
> public $components = array(
> 'Security'
> );
> public function index(){
> 
> /*..*/
> 
> }
> }
>
> View:
>  echo $this->Form->create('Configurations'); 
> echo $this->Form->input('Trader.name');
> 
> /
> Settings:
> table: traders
> column: has_ftp tinyint(1)
>
> View Result:
> 
>name="data[Trader][has_ftp]">
>name="data[Trader][has_ftp]">
>   Has Ftp
> 
>
> Question:
> Why create the FormHelper an additional hidden input field?!?!?!
> /
> echo $this->Form->input('Trader.has_ftp');
> echo $this->Form->input('Ftp.ftp_server');
> echo $this->Form->input('Ftp.ftp_login_name');
> echo $this->Form->input('Ftp.ftp_password');
> echo $this->Form->input('Ftp.root_directory');
> 
> /
> Settings:
>  table: ftps
>  column: vendor tinyint(1)
>
>  View Result:
> 
>  Vendor
>  
>
>
> Question:
> The FormHelper creates an input field instead of a checkbox!?!?! 
> ***/
>
> echo $this->Form->input('Ftp.vendor');
> echo $this->Form->end('Absenden');
>
> //What i´m doing wrong?
>

-- 
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: cant open cake book :(

2012-04-20 Thread euromark
just the index is broken
go here for now:
http://book.cakephp.org/2.0/en/contents.html 

i am sure somebody from the core team will fix it ASAP


Am Freitag, 20. April 2012 14:51:48 UTC+2 schrieb Sipatshi:
>
> hi all,
>
> cant open http://book.cakephp.org/2.0/en/ !?!?! server problem?
>
> That show me: Content-Encoding-Error
>
>
>

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


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


Re: Query produced by $this->User->save($this->data); gives error

2012-04-20 Thread euromark
+1 for stork on completeness (listing all possibilities)


Am Freitag, 20. April 2012 12:47:25 UTC+2 schrieb Mangesh Sathe:
>
> Thanks ,  
>  
>   this worked .
>
> On Fri, Apr 20, 2012 at 14:13, stork  wrote:
>
>> Always call as first
>>
>> $this->User->create(); //see the API
>>
>> and then either
>>
>> $fieldList = array(...);
>> $this->User->set($this->request->data);
>> $this->User->set('field', 'value');
>> $this->User->save(null, true, $fieldList);
>>
>> or directly
>>
>> $this->User->save($this->request->data, true, array(...));
>>
>> Which fields will be saved, it is decided by combination of two factors - 
>> which fields are present in data, and which fields are specified in 
>> whitelist array. Usage of whitelist (3rd param of Model::save()) is good 
>> habit - if form fields are generated by FormHelper and controller uses 
>> SecurityComponent, you don't have to worry about form tampering in client's 
>> browser, but it is better/safer to tell model about desired fields anyway.
>>
>>  -- 
>> 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
>>
>
>
>
> -- 
> * マンゲシュサテ*
> * MANGESHSATHE*
> 
>
>

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


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


Re: Cake Bake 2.1.1

2012-04-19 Thread euromark
always do it this way:

- navigate to your app dir
- then call cake relativly:

app\>../lib/Cake/Console/cake ...


Am Freitag, 20. April 2012 00:37:12 UTC+2 schrieb Toren Valone:
>
> I am having issues with cake bake for 2.1 
>
> I navigated to the Console directory and ./cake bake 
>
> I was asked questions that Bake in 1.3 did not ask 
>
> What is the path to the project you want to bake? 
>
> I assume it is the path so i put that in, but the stumper for me is 
>
> What is the path to the directory layout you wish to copy? 
>
> When i took the default, my website went blank. So what the heck is 
> supposed to go here? 
>
> Welcome to CakePHP v2.1.1 Console 
>
> --- 
>
> App : Console 
>
> Path: //srv/www/www.cross-town-traffic-software.com/public_html/ 
> freeboat/app/Console/
>  
>
> --- 
>
> What is the path to the project you want to bake? 
>
> [srv/www/www.cross-town-traffic-software.com/public_html/freeboat/app/ 
> Console/myapp]
>  
> > srv/www/w 
>
> ww.cross-town-traffic-software.com/public_html/freeboat/app 
>
> What is the path to the directory layout you wish to copy? 
>
> [/srv/www/www.cross-town-traffic-software.com/public_html/freeboat/lib/ 
> Cake/Console/Templates/skel]
>  
>
>
> > /srv/www/www.cross-town-traffic-software.com/public_html/freeboat 
>
> Skel Directory: /srv/www/www.cross-town-traffic-software.com/ 
> public_html/freeboat
>  
>
> Will be copied to: //srv/www/www.cross-town-traffic-software.com/ 
> public_html/freeboat/app

-- 
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: Fix for error Fatal error: Class 'Debugger' not found in ... for php 5.4

2012-04-19 Thread euromark
which doesnt mean you shoudn't address the problem at some time in the 
future, though :)
it is always a good thing to make your code E_STRICT compliant - at least 
partly


Am Donnerstag, 19. April 2012 01:07:20 UTC+2 schrieb rvcT:
>
> u r right , thanks for ur correction , i am still beginner
> changing error type to   E_ALL & ~E_DEPRECATED & ~E_STRICT will also 
> disable the error
>
> On Wednesday, April 18, 2012 2:57:10 PM UTC-7, euromark wrote:
>>
>> as far as I know this is a "strict" issue and not related to a specific 
>> php version
>> if you disable strict mode in your core.php you shouldnt get any such 
>> notices regardless if you are using 5.4 or 5.3
>> correct me if I'm wrong
>>
>> but yes, some code examples might be outdated
>> the documentation can be forked and edited, though.
>> I would help, too, but my time is limited at the moment unfortunately
>>
>>
>> Am Mittwoch, 18. April 2012 17:01:55 UTC+2 schrieb rvcT:
>>>
>>> using cake 2.1.1 + php 5.4 
>>> when writing your components callback functions ensure that they have 
>>> the same declaration as there parent function in class component for 
>>> example : when using function initialize in your component make it's 
>>> declaration as
>>> public function initialize(Controller $controller) {
>>> }
>>> not "as provided in the cookbook"
>>> public function initialize($controller) {
>>> }
>>> Notice the type of the passed argument $controller is 'Controller'
>>> -
>>> i think it's php 5.4 issue , i hope someone put the notice in docs
>>>
>>

-- 
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: Fix for error Fatal error: Class 'Debugger' not found in ... for php 5.4

2012-04-18 Thread euromark
as far as I know this is a "strict" issue and not related to a specific php 
version
if you disable strict mode in your core.php you shouldnt get any such 
notices regardless if you are using 5.4 or 5.3
correct me if I'm wrong

but yes, some code examples might be outdated
the documentation can be forked and edited, though.
I would help, too, but my time is limited at the moment unfortunately


Am Mittwoch, 18. April 2012 17:01:55 UTC+2 schrieb rvcT:
>
> using cake 2.1.1 + php 5.4 
> when writing your components callback functions ensure that they have the 
> same declaration as there parent function in class component for example : 
> when using function initialize in your component make it's declaration as
> public function initialize(Controller $controller) {
> }
> not "as provided in the cookbook"
> public function initialize($controller) {
> }
> Notice the type of the passed argument $controller is 'Controller'
> -
> i think it's php 5.4 issue , i hope someone put the notice in docs
>

-- 
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 some result to elemetns

2012-04-16 Thread euromark
jesus christ - how I just love those double posts
it has already been marked as solved here:
http://ask.cakephp.org/questions/view/send_some_result_to_elemetns 


Am Montag, 16. April 2012 18:23:16 UTC+2 schrieb cricket:
>
> It's not clear what you mean by getting the data to the element. Do
> you mean that you want to render the element, or that the element
> contains a call to requestAction()? If so, just return the data
> instead of calling set().
>
> On Mon, Apr 16, 2012 at 12:38 AM, hoss7  wrote:
> > thank you cricket
> >
> > but i cant undrestand where i must put this code,this is my code:
> >
> > i have one function in newscontroller like this:
> >
> > function randomnews(){
> >
> > $rnews=$this->News-find('first',array('order'=>'Rand()');
> > $this->set('news',$rnews);
> > }
> >
> > i want send this result to some element : Elements/sidebar2.ctp
> >
> > to show some random news in this element,i dont need user request this
> > action,i need show automatic result when page loading
> >
> > i hope you can show me how can i edit this code to show result in 
> elements
> >
> > 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


Re: Where am I supposed to save additional PHP source files while I'm writing a new behavior

2012-04-16 Thread euromark
Hats off if you are new and already working on behaviors :)

Vendor would be only for third party stuff. since you write your own code 
there is only one suitable place left for library files:
/APP/Lib
Just store your files there - preferably grouped in packages (e.g. 
"MyPackageName")

for you it could be sth like
/APP/Lib/MyPackageName/MyBehaviorHelperLib.php
/APP/Lib/MyPackageName/MyOtherBehaviorHelperLib.php

and then you can use your new MyBehaviorHelperLib class by defining it at 
the top of the behavior

App::uses('MyBehaviorHelperLib', 'MyPackageName');

inside the behavior:

$MyBehaviorHelperLib = new MyBehaviorHelperLib()
$MyBehaviorHelperLib->foo();

or - if it is callable statically:

MyBehaviorHelperLib::foo();




Am Dienstag, 17. April 2012 02:05:09 UTC+2 schrieb Daniel Baird:
>
>
> Hi Cake dudes,
>
> I'm new to Cake, and I'm adding a behavior to a model.  I've done that by 
> writing a PHP file that I save in the Behavior directory.
>
> Now I'm making that Behavior a bit more complicated, and I'd like to split 
> some sections of code out into separate files.  This Behavior is pretty 
> specific to my application, I can't imagine wanting to make it a 
> redistributable plugin or anything.
>
> So here's my question: where's the recommended place to save those 
> supporting files?  Can I just make a subdir or Behavior and save them all 
> in there?  Or am I supposed to save my additional files into the Vendor dir 
> or something like that.
>
> Thanks in advance
>
> Daniel
>

-- 
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 redirect two pages back?

2012-04-16 Thread euromark
@cricket
almost perfect - I would not pass the referer this way, though. creates 
overhead
and then I don't think the else case inside the post() is necessary.
after a post the same post data will populate the inputs anyway. therefore 
the Model.referer input should still have the same value.
no need to resend this variable to the view.
I also dont like to unnecessarily set defaults in the view.

echo $this->Form->input('Model.referer');

public function add() {

if ($this->request->is('post')) {
// validate ...

if ($this->Model->save()) {
$referer = 
!empty($this->request->data['Model']['referer'])
? $this->request->data['Model']['referer']
: '/';// or some other fallback route of 
your choice

$this->redirect($referer);
}
} else {
$this->request->data['Model']['referer'] = $this->referer();
}
} 


you agree?


Am Montag, 16. April 2012 01:08:29 UTC+2 schrieb cricket:
>
> On first display of the form pass the referer to the view to add it to the 
> form.
>
> echo $this->Form->input('Model.referer', array('value' => $referer));
>
> public function add() {
>
> if ($this->request->is('post')) {
> 
> $referer = isset($this->request->data['Model']['referer'])
> ? $this->request->data['Model']['referer']
> : '/';// or some other fallback route of 
> your choice
> 
> // validate ...
> 
> if ($this->Model->save()) {
> 
> $this->redirect($referer);
> }
> else {
> // flash msg, log, etc.
> $this->set(compact('referer'));
> }
> }
> else {
> $this->set('referer', $this->referer());
> }
> }
>
>
> You have to use the else block to set the view var because if the save
> failed it would overwrite it to the empty form. Likewise, you need to
> create the $referer method var before attempting to save so that it's
> available either way (to redirect or reset the view var).
>
> On Sun, Apr 15, 2012 at 4:15 PM, Daniel  wrote:
> > I am using the following code to go back a page, but the problem is
> > that the action is an "add" one so it just goes back to an empty "add"
> > form:
> >
> > if ($this->request->is('post')) {
> >// blah blah ...
> >if ($this->Inemail->save($this->request->data)) {
> >// blah blah ...
> >$this->redirect($this->referer());
> >
> > I think what I need to do is go back two pages.  Is this possible?
> >
> > 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


Re: Cake Auth userScope ?

2012-04-14 Thread euromark
Simply be creating your own AuthExt component which overrides the default 
login() method:

https://github.com/dereuromark/tools/blob/2.0/Controller/AuthExtComponent.php#L108
 

PS: the class is not intended for public use (kind of ugly still from 2008, 
only upgraded without cleanup to 2.x) - only for reference in this case


Am Samstag, 14. April 2012 15:15:14 UTC+2 schrieb heohni:
>
> Hi,
>
> if a user try to login and his account is not active yet the login will 
> fail because of this:
> 'scope' => array('User.usr_active' => 1),
>
> Is there anyhow a way to catch this case to display a proper message to 
> the user?
>
> Thanks for 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: Redirect www to non-www

2012-04-14 Thread euromark
ops - copy and paste can be a .. sometiems :)

might work.
but I usually use the more generic one:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


mark



Am Samstag, 14. April 2012 07:32:16 UTC+2 schrieb creat1v1ty:
>
> Ok, thanks for all the good feedback, guys. To confirm...
>
> My website is hosted on a shared server, so my doc root is public_html, in 
> which I have a Cake installation.
>
> public_html
>  - app
>   - webroot
>- .htaccess  *(3)*
>   - .htaccess  *(2)*
>  - libs
>  - plugins
>  - vendors
>  - .htaccess  *(1)*
>  - index.php
>
> That being said, which .htaccess file should I place my redirect 
> conditions/rules in? 1, 2, or 3?
>
> Also, as kdubya posted, here is the condition/rule I plan on using:
>
> RewriteCond %{HTTP_HOST} ^domain.com$
> RewriteRule ^/?$ 
> "http\:\/\/www.domain.com<http://www.google.com/url?sa=D&q=www.domain.com&usg=AFQjCNF2VZnNvBDuFoDgI6jKjQM0LVHXaA>"
>  
> [R=301,L]
>
> Is this the best/correct usage?
>
>
>
> On Friday, April 13, 2012 8:37:46 PM UTC-5, euromark wrote:
>>
>> @kdubya: thats actually how you normally do it anyway
>> what kdubya wants is just not how it is done... (you always use www as 
>> the actual site and 301 redirect from non-www there) imo
>>
>>
>> Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>>>
>>> I realized I answered only part of your question. I have done the 
>>> opposite of what you are asking - redirecting domain.tld -> www.domain.tld 
>>> (making the www.domain.tld the canonical URL).
>>>
>>> The /site/.htaccess file I use contains:
>>> 
>>>RewriteEngine on
>>>   
>>>RewriteCond %{HTTP_HOST} ^domain.com$ 
>>>RewriteRule ^/?$ "http\:\/\/www.domain.com" [R=301,L]
>>>   
>>>RewriteRule^$ app/webroot/[L]
>>>RewriteRule(.*) app/webroot/$1 [L]
>>> 
>>>
>>> HTH,
>>> 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: Redirect www to non-www

2012-04-13 Thread euromark
@kdubya: thats actually how you normally do it anyway
what kdubya wants is just not how it is done... (you always use www as the 
actual site and 301 redirect from non-www there) imo


Am Freitag, 13. April 2012 15:51:52 UTC+2 schrieb kdubya:
>
> I realized I answered only part of your question. I have done the opposite 
> of what you are asking - redirecting domain.tld -> www.domain.tld (making 
> the www.domain.tld the canonical URL).
>
> The /site/.htaccess file I use contains:
> 
>RewriteEngine on
>   
>RewriteCond %{HTTP_HOST} ^domain.com$ 
>RewriteRule ^/?$ "http\:\/\/www.domain.com" [R=301,L]
>   
>RewriteRule^$ app/webroot/[L]
>RewriteRule(.*) app/webroot/$1 [L]
> 
>
> HTH,
> 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: CakePHP, Linux and MS Sql Server

2012-04-13 Thread euromark
quite tricky... after few more hours I got it to run :)
it only works if "port" is manually set to NULL (omitting it in the 
database file won't do it).

but with this datasource we seem to have encoding problems, though

[address] => ��� 21 �.�


there are greek utf8 letters etc. with the sqlserver datasource from cake 
(on windows) they are displayed correctly.
with yours and linux the above happens.

seems like the tables are in "Latin1_General_CI_AS" and should probably be 
converted. what if that isn't possible because it is a foreign DB?
can we convert it back to utf8? because I dont see any "encoding" 
properties in the datasource itself.


i wonder why it works with the pdo sqlserv datasource on windows
probably because in the PDO version you can set the encoding somehow
if (!empty($config['encoding'])) {
$flags[PDO::SQLSRV_ATTR_ENCODING] = $config['encoding'];
}


thank you



Am Mittwoch, 11. April 2012 21:29:24 UTC+2 schrieb euromark:
>
> We have been trying for hours getting a second datasource to work which 
> connects to a MS Sql Server (2008) from linux.
> On windows we have running the "pdo_sqlserv" extension. And with a few 
> hours of trial and error and installation of different drivers we got it up 
> and running.
> We use the following datasource:
>
> public $mssql = array(
> 'datasource' => 'Database/Sqlserver',
> 'host' => '192.168.0.2\SQLEXPRESS',
> 'login' => 'user',
> 'password' => 'pwd',
> 'database' => 'table',
> );
>
> On linux, though, we cannot get pdo_sqlserv to run (confirmed with 
> phpinfo). Only mssql (for plain mssql where is no datasource for) or 
> pdo_dblib.
> The latter is supposed to be the eqivalent to the windows pdo_sqlserv but 
> the datasource always errors with `datasource could not be created`.
>
> What does work, though, is using this manuel statement:
>
> $dsn = 'dblib:dbname=database;host=192.168.0.2\sqlexpress';
> $user = 'user';
> $password = 'pwd';
>
> $dbh = new PDO($dsn, $user, $password);
>
> $stmt = $dbh->prepare("SELECT * FROM tablename");
> $stmt->execute();
> while ($row = $stmt->fetch()) {
> ...
> }
>
> So the connection details seem to be right and the connection is 
> establishable. 
> Only the extension/module which our Sqlserver datasource is expeting is 
> not really working.
> We have to use this manual snippet which, of course, is incompatible to 
> the rest of the model code (which uses the datasource for find(first) and 
> find(all) queries).
>
> note: that we replaced "sqlserv:" with "dblib:" here in order to get it to 
> work.
> So is there some special dblib datasource here for linux? Or what's going 
> on?
> 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


Re: INSERT, UPDATE, DELETE SQL queries on Cakephp into database

2012-04-12 Thread euromark
you are probably looking for sth like this:
http://bakery.cakephp.org/articles/alkemann/2008/10/21/logablebehavior 

it is a behavior that can be attached to models in order to log the changes.


Am Freitag, 13. April 2012 00:41:08 UTC+2 schrieb thom:
>
> Hello,, I'm using cakePHP 1.3. I'd like to ask about how to save sql 
> queries on Insert, Update and Delete on CakePHP into logs-table. What I 
> need is everytime user do an insert/ update/ delete, the sql is saved with 
> another user informations into logs-table. I've been searching around and 
> found https://github.com/alkemann/CakePHP-Assets. But seems its not 
> supporting to attach the executed-query; just something like 'user_id 
> change this to this'. 
>
> I also found some links told me to override the default 
> DboMysql::_excute() but the result is just like when I saved all cake's sql 
> dump into log file.. For your information, I have a menu that I need to be 
> checked their 'visibility' based on users access right. That means, beside 
> the normal cakes 'select', there are also hundreds of sql log on checked 
> the menu.
>
> No, that's not what I want. I just want insert-update-delete queries. 
> Naaa,, Is that a possible thing to do that? Is there any way to do it? Some 
> clues will kinda helpful.
>
> Thank you for any responses.
>
> -- 
> Regards,,,
> thom
> http://mynameisthom.blogspot.com
> http://www.twitter.com/iamthom_
> http://id.linkedin.com/in/mastanto
>
>  

-- 
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: Problems running Cakephp2.1.1 with SQL Server 2008

2012-04-12 Thread euromark
did you see my post from yesterday?
https://groups.google.com/forum/?fromgroups#!topic/cake-php/8y2Y511krEU 

had the same issue, but on linux.
on windows I got it to run with the included SqlServer datasource (you need 
to follow the instructions from microsoft)
http://msdn.microsoft.com/de-de/library/cc296170(v=sql.90).aspx 
install the native client, put the dlls in its places and somehow it works 
:)

don't make the same mistake I did and forget to install the SDK, as well 
(if you are prompted for it, select everything).

for the linux version I still have to try the Mssql datasource from rchavik



Am Donnerstag, 12. April 2012 19:27:07 UTC+2 schrieb stork:
>
>
> I also download and copied the files dbo_sqlsrv.php and DboSource.php
>>
>> into my app/Model/Datasource folder but I'm getting the follow error:
>>
> 1. file dbo_sqlsrv.php is for CakePHP 1.x, for 2.x you need this one
>
> https://github.com/cakephp/datasources/blob/2.0/Model/Datasource/Database/Sqlsrv.php
>
> 2. You shouldn't need to use custom DboSource.php imho.
>

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


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


Re: CakePHP, Linux and MS Sql Server

2012-04-12 Thread euromark
no because there is no such datasource in 2.x:
https://github.com/cakephp/datasources/tree/2.0/Model/Datasource/Database 


Am Donnerstag, 12. April 2012 02:37:18 UTC+2 schrieb rchavik:
>
> Mark,
>
> Try https://groups.google.com/d/topic/cake-php/WgIhA0mj89M/discussion and 
> see wether it's relevant to your environment.
>
> On Thursday, April 12, 2012 2:52:53 AM UTC+7, euromark wrote:
>>
>> in the $mssql it's  'database' => 'database' - but thats not that 
>> important.
>>
>> we also tried the SqlSrv datasource from the Datasources plugin (cakephp 
>> github)
>> But this seems to use the sqlsrv extension which is also not available on 
>> our linux setup
>>
>>
>>
>> Am Mittwoch, 11. April 2012 21:29:24 UTC+2 schrieb euromark:
>>>
>>> We have been trying for hours getting a second datasource to work which 
>>> connects to a MS Sql Server (2008) from linux.
>>> On windows we have running the "pdo_sqlserv" extension. And with a few 
>>> hours of trial and error and installation of different drivers we got it up 
>>> and running.
>>> We use the following datasource:
>>>
>>> public $mssql = array(
>>> 'datasource' => 'Database/Sqlserver',
>>> 'host' => '192.168.0.2\SQLEXPRESS',
>>> 'login' => 'user',
>>> 'password' => 'pwd',
>>> 'database' => 'table',
>>> );
>>>
>>> On linux, though, we cannot get pdo_sqlserv to run (confirmed with 
>>> phpinfo). Only mssql (for plain mssql where is no datasource for) or 
>>> pdo_dblib.
>>> The latter is supposed to be the eqivalent to the windows pdo_sqlserv 
>>> but the datasource always errors with `datasource could not be created`.
>>>
>>> What does work, though, is using this manuel statement:
>>>
>>> $dsn = 'dblib:dbname=database;host=192.168.0.2\sqlexpress';
>>> $user = 'user';
>>> $password = 'pwd';
>>>
>>> $dbh = new PDO($dsn, $user, $password);
>>>
>>> $stmt = $dbh->prepare("SELECT * FROM tablename");
>>> $stmt->execute();
>>> while ($row = $stmt->fetch()) {
>>> ...
>>> }
>>>
>>> So the connection details seem to be right and the connection is 
>>> establishable. 
>>> Only the extension/module which our Sqlserver datasource is expeting is 
>>> not really working.
>>> We have to use this manual snippet which, of course, is incompatible to 
>>> the rest of the model code (which uses the datasource for find(first) and 
>>> find(all) queries).
>>>
>>> note: that we replaced "sqlserv:" with "dblib:" here in order to get it 
>>> to work.
>>> So is there some special dblib datasource here for linux? Or what's 
>>> going on?
>>> 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


Re: CakePHP, Linux and MS Sql Server

2012-04-11 Thread euromark
in the $mssql it's  'database' => 'database' - but thats not that important.

we also tried the SqlSrv datasource from the Datasources plugin (cakephp 
github)
But this seems to use the sqlsrv extension which is also not available on 
our linux setup



Am Mittwoch, 11. April 2012 21:29:24 UTC+2 schrieb euromark:
>
> We have been trying for hours getting a second datasource to work which 
> connects to a MS Sql Server (2008) from linux.
> On windows we have running the "pdo_sqlserv" extension. And with a few 
> hours of trial and error and installation of different drivers we got it up 
> and running.
> We use the following datasource:
>
> public $mssql = array(
> 'datasource' => 'Database/Sqlserver',
> 'host' => '192.168.0.2\SQLEXPRESS',
> 'login' => 'user',
> 'password' => 'pwd',
> 'database' => 'table',
> );
>
> On linux, though, we cannot get pdo_sqlserv to run (confirmed with 
> phpinfo). Only mssql (for plain mssql where is no datasource for) or 
> pdo_dblib.
> The latter is supposed to be the eqivalent to the windows pdo_sqlserv but 
> the datasource always errors with `datasource could not be created`.
>
> What does work, though, is using this manuel statement:
>
> $dsn = 'dblib:dbname=database;host=192.168.0.2\sqlexpress';
> $user = 'user';
> $password = 'pwd';
>
> $dbh = new PDO($dsn, $user, $password);
>
> $stmt = $dbh->prepare("SELECT * FROM tablename");
> $stmt->execute();
> while ($row = $stmt->fetch()) {
> ...
> }
>
> So the connection details seem to be right and the connection is 
> establishable. 
> Only the extension/module which our Sqlserver datasource is expeting is 
> not really working.
> We have to use this manual snippet which, of course, is incompatible to 
> the rest of the model code (which uses the datasource for find(first) and 
> find(all) queries).
>
> note: that we replaced "sqlserv:" with "dblib:" here in order to get it to 
> work.
> So is there some special dblib datasource here for linux? Or what's going 
> on?
> 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, Linux and MS Sql Server

2012-04-11 Thread euromark
We have been trying for hours getting a second datasource to work which 
connects to a MS Sql Server (2008) from linux.
On windows we have running the "pdo_sqlserv" extension. And with a few 
hours of trial and error and installation of different drivers we got it up 
and running.
We use the following datasource:

public $mssql = array(
'datasource' => 'Database/Sqlserver',
'host' => '192.168.0.2\SQLEXPRESS',
'login' => 'user',
'password' => 'pwd',
'database' => 'table',
);

On linux, though, we cannot get pdo_sqlserv to run (confirmed with 
phpinfo). Only mssql (for plain mssql where is no datasource for) or 
pdo_dblib.
The latter is supposed to be the eqivalent to the windows pdo_sqlserv but 
the datasource always errors with `datasource could not be created`.

What does work, though, is using this manuel statement:

$dsn = 'dblib:dbname=database;host=192.168.0.2\sqlexpress';
$user = 'user';
$password = 'pwd';

$dbh = new PDO($dsn, $user, $password);

$stmt = $dbh->prepare("SELECT * FROM tablename");
$stmt->execute();
while ($row = $stmt->fetch()) {
...
}

So the connection details seem to be right and the connection is 
establishable. 
Only the extension/module which our Sqlserver datasource is expeting is not 
really working.
We have to use this manual snippet which, of course, is incompatible to the 
rest of the model code (which uses the datasource for find(first) and 
find(all) queries).

note: that we replaced "sqlserv:" with "dblib:" here in order to get it to 
work.
So is there some special dblib datasource here for linux? Or what's going 
on?
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


Re: How to use HTTPS in cakephp

2012-04-10 Thread euromark
for starters the protocol (http or https) doesnt necessarily have to do 
with cake.
your application will run with both versions - you can switch easily 
between them.

you should first consult on how to install and setup the certificates, how 
to make your apache route the https connection.
if that all works, your cake app will work without any configuration at all.


Am Dienstag, 10. April 2012 23:37:29 UTC+2 schrieb Josh:
>
> Hello everyone, i want to use https in cakephp how can i use that? do i 
> need to use some security component? or do i need to change the route.php??
> Thanks in advance.
>

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


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


Re: CakePHP 2.0 Component Calling Helper

2012-04-10 Thread euromark
with 2.1 the issue should be easy to resolve.
there are now great ways to keep the code dry and still use all classes 
accordingly:
http://www.dereuromark.de/2012/04/10/cakephp-now-fully-mvc/ 

You would make a Cleaner lib in /Utility and then you can still use some 
CleanerHelper with internally calls the Lib class.
Try to keep the method static for the controller/component level. Then 
there is no need to initialize it.
The helper can still work as it used to.


Am Samstag, 22. Oktober 2011 01:35:13 UTC+2 schrieb majna:
>
> there is 2.0 branch
>
> https://github.com/CakeDC/comments/blob/2.0/Controller/Component/CommentsComponent.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: SEO/Meta Data Helper

2012-04-10 Thread euromark
what I mean is that your component has callbacks like

public function beforeRender(Controller $controller) {}

in there you can check on the current controller/action or url and query 
the seo model.
if it retrieves a seo entry it can then pass it on to the view
so everything would be fully automated and all you need to do is adding the 
component to the controllers you want it to work with (or the app 
controller for all):

public $components = array('Seo.Seo');



Am Dienstag, 10. April 2012 08:32:26 UTC+2 schrieb sams:
>
> more automatically with callbacks - so that vars are ready set for the 
> helper to automatically set the meta data to the meta block
> then you could have no code added to view templates unless you want to add 
> more specific stuff at that point
> http://book.cakephp.org/1.3/view/996/Creating-Components
>
> initialize and startup within your component.
>  - S
>
>
>
>
> On 10 April 2012 05:36, creat1v1ty  wrote:
>
>> Thanks so much guys, I can't tell you how much I appreciate your 
>> experience and suggestions. I guess I need to study up more on Components 
>> and how they're supposed to work. I'm not really sure what you mean by 
>> having the component work more "automatically".
>>
>> If you're willing to provide more insight I would greatly appreciate it - 
>> otherwise I will do some more homework and see what I can figure out. 
>> Thanks again!
>>
>>
>>
>> On Monday, April 9, 2012 8:47:41 PM UTC-5, euromark wrote:
>>
>>> I was more thinking about a more "automatically" working component then
>>> Which - if enabled - fetches the appropriate meta information for this 
>>> action and passes it on.
>>> this component can also add the helper automatically and the helper 
>>> would do the rest on its own.
>>> otherwise you are not using the full potential of it.
>>>
>>> and using a behavioral approach as Thiago suggested would probably also 
>>> work.
>>> But I' probably go for the component.
>>>
>>>
>>> Am Dienstag, 10. April 2012 03:36:48 UTC+2 schrieb Thiago Belem:
>>>>
>>>> Why don't you put this getMeta method inside your model or create a 
>>>> behavior?
>>>>
>>>>  
>>>>
>>> Thiago Belem
>>>>
>>>> Enviado do meu Android (e sujeito a erros do corretor automático)
>>>> Em 09/04/2012 22:24, "creat1v1ty" escreveu:
>>>>
>>>> Thanks again euromark - I've taken your advice and tips and created a 
>>>>> SEO Component, which I feel is the best solution. It keeps my MVC 
>>>>> conventions in tact and hopefully is a more efficient way of doing what I 
>>>>> need to do.
>>>>>
>>>>> Here is what I have now:
>>>>>
>>>>> *SeoComponent.php*
>>>>> ==**===
>>>>> public function getTags($page) {
>>>>> App::import('Model', 'Meta');
>>>>> $Model = ClassRegistry::init('Meta');
>>>>> $seo_data = $Model->find('first', array('conditions' => 
>>>>> array('Meta.page' => $page)));
>>>>> $seo_tags['title'] = $seo_data['Meta']['title'];
>>>>> $seo_tags['description'] = $seo_data['Meta']['**description'];
>>>>> $seo_tags['keywords'] = $seo_data['Meta']['keywords'];
>>>>> return $seo_tags;
>>>>> }
>>>>>
>>>>> *PagesController.php*
>>>>> ==**===
>>>>> public function home($page) {
>>>>> $this->set('page', $page);
>>>>> $this->set('seo_tags', $this->Seo->getTags($page));
>>>>> }
>>>>>
>>>>> *default.ctp*
>>>>> ==**===
>>>>> 
>>>>> 
>>>>> 
>>>>>
>>>>>
>>>>> Please feel free to comment and/or make suggestions on any ways I 
>>>>> might be able to further refine/improve. Thanks again for all your help!
>>>>>
>>>>>
>>>>>
>>>>> On Monday, April 9, 2012 7:33:19 PM UTC-5, euromark wrote:
>>>>>>
>>>>>> I am not saying you can never break MVC or

Re: SEO/Meta Data Helper

2012-04-09 Thread euromark
I was more thinking about a more "automatically" working component then
Which - if enabled - fetches the appropriate meta information for this 
action and passes it on.
this component can also add the helper automatically and the helper would 
do the rest on its own.
otherwise you are not using the full potential of it.

and using a behavioral approach as Thiago suggested would probably also 
work.
But I' probably go for the component.


Am Dienstag, 10. April 2012 03:36:48 UTC+2 schrieb Thiago Belem:
>
> Why don't you put this getMeta method inside your model or create a 
> behavior?
>
>  
>
Thiago Belem
>
> Enviado do meu Android (e sujeito a erros do corretor automático)
> Em 09/04/2012 22:24, "creat1v1ty"  escreveu:
>
>> Thanks again euromark - I've taken your advice and tips and created a SEO 
>> Component, which I feel is the best solution. It keeps my MVC conventions 
>> in tact and hopefully is a more efficient way of doing what I need to do.
>>
>> Here is what I have now:
>>
>> *SeoComponent.php*
>> =
>> public function getTags($page) {
>> App::import('Model', 'Meta');
>> $Model = ClassRegistry::init('Meta');
>> $seo_data = $Model->find('first', array('conditions' => 
>> array('Meta.page' => $page)));
>> $seo_tags['title'] = $seo_data['Meta']['title'];
>> $seo_tags['description'] = $seo_data['Meta']['description'];
>> $seo_tags['keywords'] = $seo_data['Meta']['keywords'];
>> return $seo_tags;
>> }
>>
>> *PagesController.php*
>> =
>> public function home($page) {
>> $this->set('page', $page);
>> $this->set('seo_tags', $this->Seo->getTags($page));
>> }
>>
>> *default.ctp*
>> =
>> 
>> 
>> 
>>
>>
>> Please feel free to comment and/or make suggestions on any ways I might 
>> be able to further refine/improve. Thanks again for all your help!
>>
>>
>>
>> On Monday, April 9, 2012 7:33:19 PM UTC-5, euromark wrote:
>>>
>>> I am not saying you can never break MVC or cake conventions. I do so 
>>> myself occasionally. But it should have sane reasoning then.
>>> In your case it could be also solved using a component which does what 
>>> you are doing in the view - fetching the data from the model.
>>> It could then pass it down to the view level where you only have to 
>>> display it.
>>> That would be in MVC (fetching model data in the view layer is 
>>> considered breaking it).
>>>
>>> But your solution simplifies the task. So as long as it doesn't break 
>>> other (real) things it is not completely wrong to intentionally go down 
>>> this road.
>>>
>>>
>>>
>>> Am Dienstag, 10. April 2012 00:07:24 UTC+2 schrieb creat1v1ty:
>>>>
>>>> Thanks very much for the insights, euromark. Here is some additional 
>>>> info based on your questions:
>>>>
>>>> *Not sure if breaking MVC is really the best way to go here* - 
>>>> breaking MVC is not something I am doing intentionally. To be completely 
>>>> honest, I don't know how doing what I'm doing breaks MVC...perhaps you can 
>>>> help me understand that. My goal is to keep my code as clean and semantic 
>>>> as possible.
>>>>
>>>> *Also not sure how you want to pass $page (is it the final url after 
>>>> routing or the prefix/plugin/controller/action/ string?)* - for the 
>>>> pages of the site that are managed by the PagesController, I am relying on 
>>>> the default variable Cake uses ($page), which is set in routes.php.
>>>>
>>>> *ex:  Router::connect('/about', array('controller' => 'pages', 
>>>> 'action' => 'display', 'about'));*
>>>>
>>>> For pages not managed by the PagesController, I am setting the $page 
>>>> variable for each action in that controller.
>>>>
>>>> *ex:  $this->set('page', 'contact-index');*
>>>>
>>>> *If you want people to contribute and discuss your code in detail, you 
>>>> should open a github rep for it* - I appreciate the tip and will 
>>>> definitely keep th

Re: SEO/Meta Data Helper

2012-04-09 Thread euromark
I am not saying you can never break MVC or cake conventions. I do so myself 
occasionally. But it should have sane reasoning then.
In your case it could be also solved using a component which does what you 
are doing in the view - fetching the data from the model.
It could then pass it down to the view level where you only have to display 
it.
That would be in MVC (fetching model data in the view layer is considered 
breaking it).

But your solution simplifies the task. So as long as it doesn't break other 
(real) things it is not completely wrong to intentionally go down this road.



Am Dienstag, 10. April 2012 00:07:24 UTC+2 schrieb creat1v1ty:
>
> Thanks very much for the insights, euromark. Here is some additional info 
> based on your questions:
>
> *Not sure if breaking MVC is really the best way to go here* - breaking 
> MVC is not something I am doing intentionally. To be completely honest, I 
> don't know how doing what I'm doing breaks MVC...perhaps you can help me 
> understand that. My goal is to keep my code as clean and semantic as 
> possible.
>
> *Also not sure how you want to pass $page (is it the final url after 
> routing or the prefix/plugin/controller/action/ string?)* - for the pages 
> of the site that are managed by the PagesController, I am relying on the 
> default variable Cake uses ($page), which is set in routes.php.
>
> *ex:  Router::connect('/about', array('controller' => 'pages', 'action' 
> => 'display', 'about'));*
>
> For pages not managed by the PagesController, I am setting the $page 
> variable for each action in that controller.
>
> *ex:  $this->set('page', 'contact-index');*
>
> *If you want people to contribute and discuss your code in detail, you 
> should open a github rep for it* - I appreciate the tip and will 
> definitely keep this in mind going forward. With this request, however, the 
> code I've written is pretty minimal - the extent of it is in my original 
> post. I do understand, however, that seeing code in its context is much 
> more efficient.
>
> *PS: it also sounds like something that could be made a "Seo" plugin to 
> make it available for multiple apps.* - I agree completely, and would 
> love to pass something beneficial along to others to use as well. However, 
> I don't really feel comfortable pitching something that isn't built 
> correctly, or outside of MVC conventions. Also, I don't really have the 
> experience with Cake to understand what's needed to build a plugin, and how 
> I can take what I've done and turn it into one. That being said, I am 
> definitely open to suggestions and help in doing it.
>
> Thanks again, euromark.
>
> On Monday, April 9, 2012 4:31:33 PM UTC-5, euromark wrote:
>>
>> IF you really need to use a model in this context you should never use 
>> "new" but ClassRegistry:
>>
>> $Model = ClassRegistry::init('Meta');
>>
>> Not sure if breaking MVC is really the best way to go here. But if it 
>> works for you, nobody will force you to 
>> undo your obviously working code. Also not sure how you want to pass 
>> $page (is it the final url after routing or
>> the prefix/plugin/controller/action/ string? both solutions could work, 
>> might have different pros and cons.
>> Other than that it looks fine. I know there are some plugins which do it 
>> not that much different you do.
>>
>> Without specific inside in your application there is only so much one can 
>> suggest.
>> Just take the "silence" regarding your thread as a "not beautiful, but 
>> not really problematic either".
>> Everything else is your thing. Not ours.
>> If you want people to contribute and discuss your code in detail, you 
>> should open a github rep for it.
>> So others can fork or submit issues. Reading through a lot of code 
>> without code highlighting is no fun.
>>
>> PS: it also sounds like something that could be made a "Seo" plugin to 
>> make it available for multiple apps.
>> you never know when you will need it (or others for that matter). Just 
>> something to think about.
>> But then use: `$Model = ClassRegistry::init('Seo.Meta');` :)
>>
>> good luck
>> mark
>>
>>
>> Am Montag, 9. April 2012 21:37:51 UTC+2 schrieb creat1v1ty:
>>>
>>> anyone out there have any suggestions/recommendations for me?
>>>
>>> Thanks in advance.
>>>
>>

-- 
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: SEO/Meta Data Helper

2012-04-09 Thread euromark
IF you really need to use a model in this context you should never use 
"new" but ClassRegistry:

$Model = ClassRegistry::init('Meta');

Not sure if breaking MVC is really the best way to go here. But if it works 
for you, nobody will force you to 
undo your obviously working code. Also not sure how you want to pass $page 
(is it the final url after routing or
the prefix/plugin/controller/action/ string? both solutions could work, 
might have different pros and cons.
Other than that it looks fine. I know there are some plugins which do it 
not that much different you do.

Without specific inside in your application there is only so much one can 
suggest.
Just take the "silence" regarding your thread as a "not beautiful, but not 
really problematic either".
Everything else is your thing. Not ours.
If you want people to contribute and discuss your code in detail, you 
should open a github rep for it.
So others can fork or submit issues. Reading through a lot of code without 
code highlighting is no fun.

PS: it also sounds like something that could be made a "Seo" plugin to make 
it available for multiple apps.
you never know when you will need it (or others for that matter). Just 
something to think about.
But then use: `$Model = ClassRegistry::init('Seo.Meta');` :)

good luck
mark


Am Montag, 9. April 2012 21:37:51 UTC+2 schrieb creat1v1ty:
>
> anyone out there have any suggestions/recommendations for me?
>
> Thanks in advance.
>

-- 
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: AutoLoginComponent Question

2012-04-08 Thread euromark
as you said - there is a lot of magic going on. so besides the login() 
statement there is nothing else

but you can put these in your app controller - they will tell you more:


protected function _autoLogin() {
$this->log('SUCCESS - ' . $this->Session->read('Auth.User.id'), 
'autologin');
 if (Configure::read('debug') > 0) {
$this->Common->flashMessage('AutoLogin', 'info');
}
}

protected function _autoLoginError() {
$this->log('ERROR - ' . $this->Session->read('Auth.User.id'), 'autologin');

if (Configure::read('debug') > 0) {
$this->Common->flashMessage('AutoLogin Error!', 'info');
}
}

you just need to switch the flashMessage statement against yours (or the 
default cake one)


Am Sonntag, 8. April 2012 14:19:57 UTC+2 schrieb heohni:
>
> well, I can see the checkbox, because of
> if (Configure::read('AutoLogin.active')) {
> echo $this->Form->input('auto_login', array('type'=>'checkbox', 
> 'label'=>__('Remember on this computer')));
> }
>
> 'requirePrompt' => true // no changes made here
>
> But I belive that the point is the redirection part. I will dive into that.
> I am not really sure if I understand what you said before...
>
> where do I have to debug what?
>
> don't you have an example login function from one of your projects where I 
> can study the code and learn from 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


Re: AutoLoginComponent Question

2012-04-08 Thread euromark
my guess:

you either didnt set requirePrompt to false OR you didnt provide the 
checkbox in the login form.
this way it will also skip the cookie creation


Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni:
>
> Hi, I tried to setup this AutoLoginComponent Component from 
> http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/
>
> But while debugging the script as nothing happend eg no cookie was created 
> I found out that on a initial setup I never pass the 
> initialize function
>
> There is this line 
>
> if (!$this->settings['active'] || !empty($user) || !$cookie || 
> !$controller->request->is('get')) {
>
> I debugged this;
> debug(!$this->settings['active']); => false
> debug(!empty($user)); => true
> debug(!$cookie); => true
> debug(!$controller->request->is('get'); => true
>
> So why is this check at this point? And why I have this never the chance 
> to pass this if and continue within the script?
>
> Please advice!
>
>
>
>
>  
>

-- 
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: AutoLoginComponent Question

2012-04-08 Thread euromark
you need to debug beforeRedirect() in there
thats where the cookie is stored
and only if you are currently in the login action:
"case $this->settings['loginAction']:"

initialize() and the rest of the code is for reading the cookie and if 
necessary to log in the user



Am Sonntag, 8. April 2012 13:50:24 UTC+2 schrieb heohni:
>
> But then I wonder how I do that?
> I mean, there is a lot of magic going on, my login looks like this:
>
> public function login() {
>if ($this->Auth->login()) {
>...
>
> What do I have to do that the cookie creation happens before the login 
> happens?
>
> Mark, I am so thankful that you are helping me, even on a Sunday and 
> Eastern!!
>
>
>
>
>
> Am Sonntag, 8. April 2012 13:44:32 UTC+2 schrieb euromark:
>>
>> of course it will
>> If $user is not empty - and you already have a logged in user
>>
>> the cookie willl only be created upon login just before the redirect
>>
>>
>> Am Sonntag, 8. April 2012 13:20:15 UTC+2 schrieb heohni:
>>>
>>> Because it runs still into the if , do the return; and the script stops 
>>> at this point for me.
>>> That is my problem :-)
>>> This way the cookie will never be created.
>>>
>>> Am Sonntag, 8. April 2012 13:07:06 UTC+2 schrieb euromark:
>>>>
>>>> so where is your problem?
>>>> looking at your debug statement, everything is all right
>>>> ! <=> NOT
>>>> so
>>>> !true === false
>>>>
>>>> and it will only run into the skip if it would be true (and active 
>>>> would be false) here
>>>>
>>>>
>>>>
>>>> Am Sonntag, 8. April 2012 12:51:11 UTC+2 schrieb heohni:
>>>>>
>>>>> If I do a debug($this->settings);
>>>>> I get
>>>>>
>>>>> array(
>>>>>   'password' => '*',
>>>>>   'active' => true,
>>>>>   'model' => 'User',
>>>>>   'username' => 'username',
>>>>>   'plugin' => '',
>>>>>   'controller' => 'users',
>>>>>   'loginAction' => 'login',
>>>>>   'logoutAction' => 'logout',
>>>>>   'cookieName' => 'autoLogin',
>>>>>   'expires' => '+2 weeks',
>>>>>   'redirect' => false,
>>>>>   'requirePrompt' => true,
>>>>>   'debug' => null
>>>>> )
>>>>>
>>>>> if (!$this->settings['active'] || !empty($user) || !$cookie || 
>>>>> !$controller->request->is('get')) {
>>>>> debug(!$this->settings['active']); => false
>>>>> debug(!empty($user)); => false
>>>>> debug(!$cookie); => true
>>>>> debug(!$controller->request->is('get')); => 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


Re: AutoLoginComponent Question

2012-04-08 Thread euromark
of course it will
If $user is not empty - and you already have a logged in user

the cookie willl only be created upon login just before the redirect


Am Sonntag, 8. April 2012 13:20:15 UTC+2 schrieb heohni:
>
> Because it runs still into the if , do the return; and the script stops at 
> this point for me.
> That is my problem :-)
> This way the cookie will never be created.
>
> Am Sonntag, 8. April 2012 13:07:06 UTC+2 schrieb euromark:
>>
>> so where is your problem?
>> looking at your debug statement, everything is all right
>> ! <=> NOT
>> so
>> !true === false
>>
>> and it will only run into the skip if it would be true (and active would 
>> be false) here
>>
>>
>>
>> Am Sonntag, 8. April 2012 12:51:11 UTC+2 schrieb heohni:
>>>
>>> If I do a debug($this->settings);
>>> I get
>>>
>>> array(
>>> 'password' => '*',
>>> 'active' => true,
>>> 'model' => 'User',
>>> 'username' => 'username',
>>> 'plugin' => '',
>>> 'controller' => 'users',
>>> 'loginAction' => 'login',
>>> 'logoutAction' => 'logout',
>>> 'cookieName' => 'autoLogin',
>>> 'expires' => '+2 weeks',
>>> 'redirect' => false,
>>> 'requirePrompt' => true,
>>> 'debug' => null
>>> )
>>>
>>> if (!$this->settings['active'] || !empty($user) || !$cookie || 
>>> !$controller->request->is('get')) {
>>> debug(!$this->settings['active']); => false
>>> debug(!empty($user)); => false
>>> debug(!$cookie); => true
>>> debug(!$controller->request->is('get')); => 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


Re: AutoLoginComponent Question

2012-04-08 Thread euromark
so where is your problem?
looking at your debug statement, everything is all right
! <=> NOT
so
!true === false

and it will only run into the skip if it would be true (and active would be 
false) here



Am Sonntag, 8. April 2012 12:51:11 UTC+2 schrieb heohni:
>
> If I do a debug($this->settings);
> I get
>
> array(
>   'password' => '*',
>   'active' => true,
>   'model' => 'User',
>   'username' => 'username',
>   'plugin' => '',
>   'controller' => 'users',
>   'loginAction' => 'login',
>   'logoutAction' => 'logout',
>   'cookieName' => 'autoLogin',
>   'expires' => '+2 weeks',
>   'redirect' => false,
>   'requirePrompt' => true,
>   'debug' => null
> )
>
> if (!$this->settings['active'] || !empty($user) || !$cookie || 
> !$controller->request->is('get')) {
> debug(!$this->settings['active']); => false
> debug(!empty($user)); => false
> debug(!$cookie); => true
> debug(!$controller->request->is('get')); => 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


Re: AutoLoginComponent Question

2012-04-08 Thread euromark
I pushed an updated file
but your problem must be in your code somewhere

this setting can never ever become "false" if you don't overwrite it 
manually.

try to debug $this->settings itself (does it still contain all the keys?)



Am Sonntag, 8. April 2012 12:46:44 UTC+2 schrieb heohni:
>
> No,
>
> $config['AutoLogin'] = array(
> 'active' => true,
>
> and
>
> protected $_defaults = array(
>   'active' => true,
>
> Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni:
>>
>> Hi, I tried to setup this AutoLoginComponent Component from 
>> http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/
>>
>> But while debugging the script as nothing happend eg no cookie was 
>> created I found out that on a initial setup I never pass the 
>> initialize function
>>
>> There is this line 
>>
>> if (!$this->settings['active'] || !empty($user) || !$cookie || 
>> !$controller->request->is('get')) {
>>
>> I debugged this;
>> debug(!$this->settings['active']); => false
>> debug(!empty($user)); => true
>> debug(!$cookie); => true
>> debug(!$controller->request->is('get'); => true
>>
>> So why is this check at this point? And why I have this never the chance 
>> to pass this if and continue within the script?
>>
>> Please advice!
>>
>>
>>
>>
>>  
>>
>

-- 
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: AutoLoginComponent Question

2012-04-08 Thread euromark
yes, it is active by default:
https://github.com/dereuromark/cake-auto_login/blob/master/Controller/Component/AutoLoginComponent.php#L49
 

so you might have overwritten it somewhere in your configs


Am Sonntag, 8. April 2012 12:07:22 UTC+2 schrieb euromark:
>
> Well, you can dynamically activate/deactivate it via Configure::write().
>
> Put this in your configs:
>
> $config['AutoLogin'] = array(
> 'active' => 1
> );
>
> I was under the impression that the default value was 1. But I will look 
> into that.
>
>
>
> Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni:
>>
>> Hi, I tried to setup this AutoLoginComponent Component from 
>> http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/
>>
>> But while debugging the script as nothing happend eg no cookie was 
>> created I found out that on a initial setup I never pass the 
>> initialize function
>>
>> There is this line 
>>
>> if (!$this->settings['active'] || !empty($user) || !$cookie || 
>> !$controller->request->is('get')) {
>>
>> I debugged this;
>> debug(!$this->settings['active']); => false
>> debug(!empty($user)); => true
>> debug(!$cookie); => true
>> debug(!$controller->request->is('get'); => true
>>
>> So why is this check at this point? And why I have this never the chance 
>> to pass this if and continue within the script?
>>
>> Please advice!
>>
>>
>>
>>
>>  
>>
>

-- 
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: AutoLoginComponent Question

2012-04-08 Thread euromark
Well, you can dynamically activate/deactivate it via Configure::write().

Put this in your configs:

$config['AutoLogin'] = array(
'active' => 1
);

I was under the impression that the default value was 1. But I will look 
into that.



Am Sonntag, 8. April 2012 11:07:29 UTC+2 schrieb heohni:
>
> Hi, I tried to setup this AutoLoginComponent Component from 
> http://www.dereuromark.de/2012/02/02/more-persistent-sessions-in-cake2-x/
>
> But while debugging the script as nothing happend eg no cookie was created 
> I found out that on a initial setup I never pass the 
> initialize function
>
> There is this line 
>
> if (!$this->settings['active'] || !empty($user) || !$cookie || 
> !$controller->request->is('get')) {
>
> I debugged this;
> debug(!$this->settings['active']); => false
> debug(!empty($user)); => true
> debug(!$cookie); => true
> debug(!$controller->request->is('get'); => true
>
> So why is this check at this point? And why I have this never the chance 
> to pass this if and continue within the script?
>
> Please advice!
>
>
>
>
>  
>

-- 
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: sending emails question

2012-04-07 Thread euromark
but the code is still open source (and not encrypted) - and with a quick 
glance at its method the question would have resolved itself.
https://github.com/cakephp/cakephp/blob/2.1/lib/Cake/Network/Email/CakeEmail.php#L1079
 


Am Samstag, 7. April 2012 21:04:00 UTC+2 schrieb heohni:
>
> Because here: 
> http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#CakeEmailis 
> no reset mentioned.
>
> Am Samstag, 7. April 2012 18:37:15 UTC+2 schrieb heohni:
>>
>> Hi,
>>
>> I having a newsletter registration where I want to send an email to the 
>> user and to the admin.
>> For now I only send to user this way:
>> // send email to user to confirm
>> $email = new CakeEmail();
>> $email->helpers(array('Html', 'Text'));
>> .
>> $email->send();
>>
>> How do I send another email to admin now?
>> Same time, but just different ->to  ->subject and body?
>>
>> Can I somehow reset the vars I set before to fill them with the new data 
>> and send again?
>>
>> Thanks! And happy eastern!
>>
>

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


<    1   2   3   4   5   6   7   8   9   10   >