Re: Creating PDF with cakePHP and TCPDF

2014-09-26 Thread Dakota
I would highly recommend using the Cake PDF plugin from Friends of Cake. It 
makes PDF generation very easy. You can get It from 
https://github.com/friendsofcake/cakepdf

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Making callbacks in associated models work

2014-09-26 Thread Radharadhya Dasa
It happens if the *dependent* key is set to true.


* Otherwise it should not happen.rrd*

2014-09-26 10:57 GMT+02:00 Mateusz 2131 :

> Hi.
>
> When I delete a record, it's associated records are deleted as well and
> that works perfectly, but the callbacks (before/afterDelete) in those
> associated models are never called.
> Somehow, I managed to fix this behavior just by adding
>
> App::import('model', 'AssociatedModel');
>
> in my parent model (with this line of code, the callbacks are actually
> invoked).
>
> I don't understand this behavior. What am I possibly doing wrong, or why
> am I able to fix it this way?
> Can someone point me to the right direction?
>
> --
> Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Increase application process speed

2014-09-26 Thread euromark
If you are talking about CakePHP2.x, use model associations as everything 
is lazy loaded and bind on the fly only creates more code overhead and is 
less DRY.

If you use the core ACL it will for sure have some impact, as row level 
access is usually overkill. But then again its hard to say if it is 
necessary or not if you
dont know the details.
If you want something without much overhead, you can take a look 
at 
http://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/
 
for example.
Always depends on your demands, what you require it to be able to.
mark


Am Freitag, 26. September 2014 15:55:04 UTC+2 schrieb marco metal:
>
> Hi,
>
> If we have a very large scale application, should we use model association 
> in model itself or should we bind and unbind model on the fly in 
> controller. Does it effect the overall speed of the application.
>
> Also does implementing Acl and Auth decreases application speed?  
>

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple role Authorization not working (based on tutorial) Cake 2.5.4

2014-09-26 Thread euromark
Just in case you want to keep the controllers lean and all that authorize 
code out of it in a central file,
you might be interested in taking a look 
at 
http://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/

I always like to code DRY and with clear responsibilities.
Mark


Am Donnerstag, 25. September 2014 18:06:55 UTC+2 schrieb MarkB:
>
> Actually, it wasn't the *beforeFilter*... I had actually also not set up 
> the access rights in my various controllers *isAuthorized *functions
>
> public function isAuthorized($user) {
> if (in_array($this->action, array('dashboard','edit','etcetera'))) {
> return true;
> } 
> return parent::isAuthorized($user);
> } 
>
>
> *I know... RTFM.*
>
>
> *:)*
>
> On Thursday, 25 September 2014 09:49:02 UTC+1, Dario Savella wrote:
>>
>> I think you will need to refer to the passed $user argument as shown in 
>> the docs: 
>> 
>>
>> public function isAuthorized($user) {
>> // Admin can access every action
>> if (isset($user['role']) && $user['role'] === 'admin') {
>>return true;
>> }
>> // Default deny
>> return false;
>> }
>>
>>
>>
>>

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Increase application process speed

2014-09-26 Thread Marcus James
Hi,

If we have a very large scale application, should we use model association
in model itself or should we bind and unbind model on the fly in
controller. Does it effect the overall speed of the application.

Also does implementing Acl and Auth decreases application speed?

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Making callbacks in associated models work

2014-09-26 Thread Mateusz 2131
Hi.

When I delete a record, it's associated records are deleted as well and 
that works perfectly, but the callbacks (before/afterDelete) in those 
associated models are never called.
Somehow, I managed to fix this behavior just by adding 

App::import('model', 'AssociatedModel');

in my parent model (with this line of code, the callbacks are actually 
invoked).

I don't understand this behavior. What am I possibly doing wrong, or why am 
I able to fix it this way?
Can someone point me to the right direction?

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: pass date as paramater in view

2014-09-26 Thread Stephen S
In the most simple example I can think of, for something like this:

*http://www.mysite.com/lessons/dashboard4/2014-09-01
*
$this->Html->link('title', array('controller' => 'lessons', 'action' =>
'dashboard4', $date);

*http://www.mysite.com/lessons/dashboard4/start:2014-09-01/end:2014-09-26
*
$this->Html->link('title', array('controller' => 'lessons', 'action' =>
'dashboard4', 'start' => $dateStart, 'end' => $dateEnd));

I'd check out this post by euromark
http://www.dereuromark.de/2013/05/04/passed-named-or-query-string-params/

Personally I'd be more inclined to send search data via ajax with the use
of an element that re-renders with the new query results on success, but
that's just my 2 cents on search filters.

On 23 September 2014 13:15, ajt  wrote:

> Hi,
>
> How do I pass the date field below entered as a parameter so I can search
> the date?
>
> echo $this->Form->input(
> 'custom date',
> array(
> 'type' => 'date',
> 'selected' => array(
> 'year'=>date('Y')
> ),
> 'minYear' => date('Y') ,
> 'maxYear' => date('Y') +1
> )
> );
>
>   echo  $this->Html->link($this->Html->tag('i', '', array('class'
> => 'icon-book','title'=>'Report')).'Custom Range', array(
>  'controller' => 'lessons',  'action' => 'dashboard4'
> ),array('escape'=>false,'class' => 'btn btn-small'));
>
>
>  --
> Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kind Regards
 Stephen Speakman

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Applying New corner badge on any new folder or sub-folder each time

2014-09-26 Thread Stephen S
Hi

What is it you're having difficulty with in particular? You should be able
to just check the created date, if within a certain period, add a class etc
to display the banner over the image.

On 26 September 2014 07:59, kunal ghosh  wrote:

> hi,
> I am getting problem on a task in which i have to create a new badge
> corner when an folder or sub-folder is been created.The badge should
> display with new text on each folders.Please find the attached document
> related with my query.
>
> --
> Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kind Regards
 Stephen Speakman

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Creating PDF with cakePHP and TCPDF

2014-09-26 Thread Sudhir Pandey
Hi ,
I have follow the same steps ,
PDF are downloaded but have one problem , it shows blank content i.e no 
content.

On Thursday, 13 November 2008 17:24:03 UTC+5:30, draikin wrote:
>
> After 2 week of unsuccessful testing i hope to get some help here by 
> the community. I tried the tutorial  (http://bakery.cakephp.org/ 
> articles/view/creating-pdf-files-with-cakephp-and-tcpdf 
> )
>  
> from the 
> bakery to create PDF files from my cakePHP application. 
> At the first try i took the example code from the tutorial to generate 
> a first PDF. But in the view i got only a blank page. No download 
> started and i don't get any error message. 
> I tried to customize the tutorialcode to simplify it. But the only 
> output i get was an empty white page. I searched this group but found 
> no discussion about this topic that give any hint. Has anyone already 
> tested this tutorial and has successfully created an simple PDF? 
>
> I also had the problem that no comment can be take on the bakery for 
> that article, as already reported in the group. 
>
> I appreciate any little hint to get the solution for this. 
>
> draikin

-- 
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.