AuthController::mapActions as getter

2014-04-15 Thread jmn2k1
Is there a way to get the list of mapped actions? I should be able to use 
the AuthController::mapAction method as getter (passing an empty array), 
but is implemented in a way that don't return anything. Is this a bug or 
there is another way to get the list of mapped actions?

Thanks!

-- 
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: Cache Help

2013-07-29 Thread jmn2k1
You must "invalidate" the cache, ie, delete the cache in a onSave callback.

On Friday, July 26, 2013 9:05:30 PM UTC-3, advantage+ wrote:
>
> Maybe I was reading wrong but I was under the impression if you cache an 
> object (find data) if it was different it would delete the original cached 
> data.
>
>  
>
> I am caching the results of a find, but as admin if I edit the record the 
> cached data is always returned not the new data.
>
>  
>
> Is ther a way to fetch new data after save and delete cached info?
>
>  
>
> *Dave Maharaj*
>
> *Freelance Designer | Developer*
> [image: Description: header_logo]
> www.movepixels.com  |  d...@movepixels.com   |  709.800.0852
>
>  
>

-- 
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/groups/opt_out.




Re: Table name with no meaning in eglish

2012-04-28 Thread jmn2k1
You can always use useTable = 'yourtablename'; The same goes for foreing 
keys.

Check: http://book.cakephp.org/2.0/en/models/model-attributes.html

On Friday, April 27, 2012 4:41:48 PM UTC-3, Mamdouh wrote:
>
> Hi I'm new to CakePHP and I'm wondering if I can use as table name a 
> words that has no meaning in english. if yes how can I do that ? 
> Thank you

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


Containable make query data already retrieved

2011-05-04 Thread jmn2k1
Hi,

I need to make some report of my multiple associations, I tried with
containable and was surprised as it resolve to bring all the data with
the proper joins, however still do multiple queries for a model that
is already joined.

$params = array(
'fields' => array(
'id', 'student_id', 'course_id',
'registration_status_id',
'registration_course_status_id', 'progress'
),
'contain' => array(
'Course' => array(
'fields' => array('id', 'title')
),
'Student' => array(
'fields' => array('id', 'firstname', 'lastname'),
'City',
'Country'
),
'CourseTracking' => array(
'fields' => array('started', 'finished')
)
),
'conditions' => array(

),
'order' => array('Student.lastname')
);
$this->Course->Registration->find('all', $params);

I have the Registration model which is a link table between Course and
Student, and the generated query is:

SELECT `Registration`.`id`, `Registration`.`student_id`,
`Registration`.`course_id`, `Registration`.`registration_status_id`,
`Registration`.`registration_course_status_id`,
`Registration`.`progress`, `CourseTracking`.`started`,
`CourseTracking`.`finished`, `Course`.`id`, `Course`.`title`,
`Student`.`id`, `Student`.`firstname`, `Student`.`lastname`,
`Student`.`country_id`, `Student`.`city_id` FROM `registrations` AS
`Registration` LEFT JOIN `courses` AS `Course` ON
(`Registration`.`course_id` = `Course`.`id`) LEFT JOIN `students` AS
`Student` ON (`Registration`.`student_id` = `Student`.`id`) LEFT JOIN
`course_trackings` AS `CourseTracking` ON
(`CourseTracking`.`registration_id` = `Registration`.`id`) WHERE
course_id IN (1, 2) ORDER BY `Student`.`lastname` ASC

Which have all the required data, however the sql dump show me one of
the following queries for every registration:

SELECT `Course`.`id`, `Course`.`title` FROM `courses` AS `Course`
WHERE `Course`.`id` = 2

The strange part is that Course and Student are associated exactly in
the same way. Any hint on how to get rid of those queries?

-- 
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: Fixing form ID

2010-08-31 Thread jmn2k1
Hi,

You usually use the form helper with the name of your user model, ie:

$this->Form->create('User');

That would make the id and name to be fixed.

Jose

On Aug 30, 6:16 pm, Alexis Laporte  wrote:
> Hello people,
>
> I'm new at this cake thing ; facing difficulties with FormHelper.
>
> Problem is : I use the helper in the layout, to output a login form
> (mail + password). Its html id changes all the time (depending upon
> the URL : its id is wheter LoginAddForm or LoginIndexForm or
> LoginEditForm, etc.). Thus, I can't get the POSTed inputs in my
> controller (since I don't know which id to use : $this-
>
> >data>['loginID']['password'])
>
> What to do ? Any way of fixing the ID ? (the API did not help :().
>
> Thanks,
> Alexis.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Performance Problems using remote database

2010-08-13 Thread jmn2k1
Not necessarily your case but once I had a similar problem, it turns
out I was using a hostname for the database server that need to do a
DNS checkout and hence slow the app down. If you're using the ip then
this is not the case.

On Aug 12, 10:14 am, Thiago Elias  wrote:
> Hey Guys..
>
> Thanks everyone for the answers.. I'll try them all here today, and I'll
> post the results soon as possible..
>
> 2010/8/12 djogo 
>
> > Hi Thiago,
>
> > I would try to replicate the entire system (lampp + your app +
> > database) in other server and check whether the "slowness" is due to
> > the server or not. You may also replicate a legacy PHP app, as you
> > call it, to check if it works well too. This replicated server will
> > allow you to test other experiments without jeopardizing your real
> > production data.
>
> > If the performance in the replicated server is equivalent to your
> > original one, check if its something in the cakephp lib. Create a
> > controller that doesn't use any models at all. If it's also slow, than
> > the problem is something about your cake, or its configuration. If
> > it's not, then it's probably your database.
>
> > Then you can start thinking about database optimization. Is all
> > queries slow? Try a simple "SELECT 1 FROM DUAL" in the legacy PHP and
> > in cakePHP. how many milisseconds each one takes (test both on the
> > browser)? Is AppController->beforeFilter doing something that may be
> > slowing down your queries?
>
> > Turn debug to 2 and for each query that it reports, check how much
> > time is it taking (it's right beside the query name). Try to run the
> > same query on the database directly and check if the timing is
> > compatible.
>
> > When my apps turn slow, I always think of the DB. Sometimes, it's just
> > a matter of creating the right indexes - for instance, if you run
> > "SELECT marafo_id, count(*) from naosei group by marafo_id", it'll be
> > really slow when you have lots (>100K) of rows and the grouped column
> > is not indexed. A simple "CREATE INDEX index_naosei_marafo_id ON
> > naosei (marafo_id);" would solve this problem.
>
> > Well, keep us all informed about these results. I'm very interested
> > because every once in a while I (and may I add, everybody =]) run into
> > this kind of problem too.
>
> > dfcp
>
> > On 11 ago, 22:29, Thiago Elias  wrote:
> > > Hi All,
>
> > > Since two or three months ago (more or less), I'm experiencing some
> > problems
> > > involving CakePHP.
>
> > > In the past, our application was using a local database connection, and
> > > performance was really nice and acceptable. Some months ago, we had to
> > > migrate the application to another server, separating the Data and the
> > Apps.
>
> > > After this change, I've lost performance in my cake App. Each request
> > takes
> > > around 10 ~ 15 seconds, and before, was 2 ~ 3,5 secs.
> > > The interesting thing is: The other legacy PHP Apps are 100% fast, and
> > even
> > > other cakeAPPs are fast too, but the difference is: My main cake app (the
> > > one that lost performance) have 80 innoDB Tables and 20 views. (used to
> > link
> > > to another databases).
>
> > > I'm using CakePHP 1.2.7, PHP 5.2. And in the Database Server, MySQL
> > Server
> > > 5.1.
> > > Our network infrastructure is really fast, and ping response between
> > servers
> > > is really nice.
>
> > > Does anyone knows why I'm losing performance just in this App when
> > connected
> > > to a remote server ?! I'm using CakePHP Debug, and ~85% of the time spent
> > in
> > > the request is lost in the CORE, and not in the app. (The core is the
> > same
> > > of the other cakeApps..)
>
> > > Please help-me (and sorry for my bad english).
>
> > > Thiago Elias
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Problem with Automagic Form Elements

2008-12-09 Thread jmn2k1

I think that in order to work you need to specify the model name in
$form->create(), you should check that the form with no "formating"
have the right model. And if it belongs to a form for another model, I
think you'll have to added the type parameter to the input by hand.

JmN

On 9 dic, 13:57, Pillow <[EMAIL PROTECTED]> wrote:
> Dear Cake People,
>
> I hope you can assist with this confusing issue.
> I am building an application in which several tables contain
> advert_start_date and advert_end_date fields. In MySQL they are set as
> the DATE type.
> The problem I am experiencing is that in the forms for one controller,
> the input is 'automagically' created as drop-down selection boxes for
> year, month, day. However, in other controllers only a simple text box
> is rendered.
> I cannot figure out why the forms are produced differently. The field
> names are identical, the data types identical. The views have just all
> been baked at this stage and contain no specific formatting details.
> Are there any other factors which could be affecting the 'automagic'
> behaviour?
> Thanks in advance,
> Ed

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Accessing $this->data in views

2008-12-09 Thread jmn2k1

You can access the data in the view in $this->data array. (not $data).

JmN

On 9 dic, 17:02, WebbedIT <[EMAIL PROTECTED]> wrote:
> Hopefully a simple one to answer.
>
> In my controllers, if I add data into the $this->data array form
> fields are automatically populated
>
>   Controller:
>   $this->data['StaffHour']['staff_id'] = 123;
>
>   View:
>   echo $form->input('StaffHour.staff_id', array('type' => 'hidden'));
>
>   HTML Output:
>    id="StaffHourStaffId" type="hidden">
>
> However when I then try to access the $data array elsewhere in the
> view it is undefined?!?
>
>   Elsewhere in view:
>   link(__('Cancel', true), array('action'=>'index',
> $data['StaffHour']['staff_id']));?>
>
> Nor can I user debug($data) ... this is highly confusing, how does the
> form helper access the $data array?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best Practices: Toggle Item In Element

2007-03-12 Thread jmn2k1

I guess this gives the same error, bc the index is still undefined, so
you should try with isset()

On Mar 9, 9:30 am, "jitka" <[EMAIL PROTECTED]> wrote:
> if (!empty($data['ticker']))


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQLite

2007-03-08 Thread jmn2k1

You should assure that the "extension=php_sqlite.dll" line in your
php.ini is uncommented..

On Mar 8, 12:42 pm, "AzenAlex" <[EMAIL PROTECTED]> wrote:
> sorry about the spam... i'm a little new to the groups and i though my
> post weren't working so i kept re-submitting...
>
> I'm running php 5.1.6 on linux so i'm guessing sqlite is already
> there. is there some configuration i can check to make sure it's
> enabled or something of that nature?
>
> On Mar 7, 8:02 pm, "nate" <[EMAIL PROTECTED]> wrote:
>
> > SQLitesupport is only available for PHP5, and you have to make sure
> > PHP is installed with it.  See here:http://php.net/sqlite
>
> > On Mar 7, 6:13 pm, "AzenAlex" <[EMAIL PROTECTED]> wrote:
>
> > > Does cakephp supportSQLite? I'm getting the impression it does
> > > however i've had no luck using it. my database.php is set up as
> > > follows:
>
> > > var $default = array('driver'=>'sqlite',
> > >  'connect'=>'sqlite_open',
> > >  'database'=>'test.db');
>
> > > and i'm getting the following error:
>
> > > Fatal error: Call to undefinded function sqlite_open() in /srv/test/
> > > cake/libs/model/dbo/dbo_sqlite.php on line 102
>
> > > any help would be greatly appreciated...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Route to custom application

2007-01-16 Thread jmn2k1


It works!

I dont know why I didnt try that before!

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Route to custom application

2007-01-16 Thread jmn2k1


Yes, the ads will be separated, but I want to access the admin from a
subdirectory of the application, like 'mydomain.com/phpadsnews' and
Cake keeps redirecting to a controller called phpadsnews (which dont
exists..).
I guest there is a simple way to do this but I cant get it... :(

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Route to custom application

2007-01-16 Thread jmn2k1


Yes, the ads will be separated, I just want to access the admin from a
subdirectory, something like 'mydomain.com/phpadsnews' but its
redirected by cake...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Route to custom application

2007-01-16 Thread jmn2k1


I need to have an ad server in my application, so I put a copy of
phpAdsNews in the /app/vendors directory (I think is the best place for
this kind of code) but now I cannot access from any url without being
"parsed" by cake... is there a way to "override" this behavior with
routes or something else?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use $ajax->sortable and update in a db?

2006-11-10 Thread jmn2k1

ups...

Where I wrote:
"the sortable don't work pretty well under IE.."
I should write:
"the sortable don't work pretty well WITH TABLES AND TRs under IE..."


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How To Store the Postion after using $ajax->drag

2006-11-10 Thread jmn2k1

I guess you should look the script.aculo.us documentation and demos
(like this one:
http://wiki.script.aculo.us/scriptaculous/page/print/SortableFloatsDemo)


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use $ajax->sortable and update in a db?

2006-11-10 Thread jmn2k1

Actually you don't have to specify the onUpdate argument... if you put
just "url" => "order" (assuming the view is part of sections
controller) it has to work.

look at my complete view code:
[code]







sortable('sortableitems', array('tag'=>'tr',
'url'=>'Order'));
?>
[/code]

The only thing that change is the tag argument, because "li" is the
default.
(As a side note: the sortable don't work pretty well under IE..)


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use $ajax->sortable and update in a db?

2006-11-08 Thread jmn2k1

Here you have more info about the parameters and other things..
http://wiki.script.aculo.us/scriptaculous/show/Sortable.create

Basically you have to do something like:


Item
Other Item


Where "1", "4" are (in this example) the ids of the items, and then add
the sortable javascript with the Ajax helper:
sortable('items', array('url'=>'order'));?>

Where "order" is an action in your controller where you can do
something like:

if (isset($_POST['items']))
{
$sortableitems = $_POST['items'];

$i = 0;
foreach ($sortableitems as $item)
{
$this->UsefulLink->id = $item;
$this->UsefulLink->saveField('order', $i);
$i++;
}
}


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---