Re: Session not cleared after browser closed

2007-07-23 Thread Tazz

Further, if I close the browserand wait a few minutes until the
sessions ends then it clears. How do i check if I'm using persistent
session? Cause I know if you close the browser completly the session
should end!

On Jul 23, 4:07 pm, Tazz <[EMAIL PROTECTED]> wrote:
> I'm using cakes built in Session helper...
>
> On Jul 23, 3:14 pm, starkey <[EMAIL PROTECTED]> wrote:
>
> > Quick stab: are you using a persistent cookie to save the session id?
>
> > On Jul 23, 1:15 pm, Tazz <[EMAIL PROTECTED]> wrote:
>
> > > Correct me if I'm wrong but a sessions should be cleared after all
> > > instances of a browser have been closed.
>
> > > For some reason cake is still keeping the session after I close all my
> > > browsers and restart it.
>
> > > To see what I mean, go to:http://www.inbeatstore.com/
>
> > > - Click Add to order on a few items.
> > > - Click the Mail Order link at the top right of the page.
> > > - See list of orders in text box.
> > > - Close all instances of your browser
> > > - Go back and add more orders.
>
> > > You will see the list got biger instead of starting from the
> > > beginning.
>
> > > Any ideas?


--~--~-~--~~~---~--~~
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: Session not cleared after browser closed

2007-07-23 Thread Tazz

I'm using cakes built in Session helper...

On Jul 23, 3:14 pm, starkey <[EMAIL PROTECTED]> wrote:
> Quick stab: are you using a persistent cookie to save the session id?
>
> On Jul 23, 1:15 pm, Tazz <[EMAIL PROTECTED]> wrote:
>
> > Correct me if I'm wrong but a sessions should be cleared after all
> > instances of a browser have been closed.
>
> > For some reason cake is still keeping the session after I close all my
> > browsers and restart it.
>
> > To see what I mean, go to:http://www.inbeatstore.com/
>
> > - Click Add to order on a few items.
> > - Click the Mail Order link at the top right of the page.
> > - See list of orders in text box.
> > - Close all instances of your browser
> > - Go back and add more orders.
>
> > You will see the list got biger instead of starting from the
> > beginning.
>
> > Any ideas?


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



Session not cleared after browser closed

2007-07-23 Thread Tazz

Correct me if I'm wrong but a sessions should be cleared after all
instances of a browser have been closed.

For some reason cake is still keeping the session after I close all my
browsers and restart it.

To see what I mean, go to: http://www.inbeatstore.com/

- Click Add to order on a few items.
- Click the Mail Order link at the top right of the page.
- See list of orders in text box.
- Close all instances of your browser
- Go back and add more orders.

You will see the list got biger instead of starting from the
beginning.

Any ideas?


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



Using activity indicator with pagination component.

2007-07-19 Thread Tazz

Hi, I implemented the pagination component and got it working with
AJAX.

Now I want to add an activity indicator when I click the next and
previous links.

Anyone done this?

On a side note this is the site I'm currently working on and using
Cake PHP.

http://www.inbeatstore.com/

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



Session issue.

2007-05-16 Thread Tazz

Not sure this is a Cake issue. I'm using dAuth component to protect my
admin pages and the users of my application have complained that they
randomly get kicked out within seconds of loging in. I have
experienced this issue as well. Login click on a link or tow and then
bam login page.

I also experienced this with another php application I installed.

Do you guys know what it could be?

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



Set the MIME type for output

2007-03-14 Thread Tazz

Hi, I want to create a view that will output a csv file so i need to
set it's mime type when rendering the page so the browser can detect
the file as coma delimitted...

How would I do so?

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



Showcase: inbeatstore.com using Cake.

2007-02-24 Thread Tazz

Who ever is interested. I completed my first site using cake. It's for
a local record store here in Montreal.

www.inbeatstore.com

Cake Version: 1.1.13.4450

Additional Components:

- ob_Auth for login to administration panel.
- Pagination from paging through "news letters" and record releases.
- Swift mailer to sends mail orders to staff.


--~--~-~--~~~---~--~~
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 validate a custom form?

2007-02-07 Thread Tazz

Well bassically I have a form that submits to an action in my
controller which sends out an e-mail... I'm not saving to a model. So
their's no automatic validation there...

On Feb 7, 5:00 am, "Steniskis" <[EMAIL PROTECTED]> wrote:
> Hi Tazz,
> Your question is not clear...
> Steniskis


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



How to validate a custom form?

2007-02-07 Thread Tazz

I have a form I would liek to validate which does not save to a
model...

How would I go about 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
-~--~~~~--~~--~--~---



E-mail validation regular expressions.

2007-02-05 Thread Tazz

Trying to use the reg express: http://regexlib.com/Search.aspx?k=email
By Philippe Benthien

and I get: Parse error: syntax error, unexpected '|', expecting ')'
in /usr/home/ads/www/cake/inbeat/models/mailing_list.php on line 8

Either the expression is to long. Or cake doesn't understand these
types of regular expressions!

Anyone have a good e-mail reg ex?

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



d_auth register always enetring same password?

2007-01-30 Thread Tazz

I just installed d_auth.. it seem to work fine for the registration,
but when I try to login I can't seem to! i went and chedk the users
table in the dn and the password hashes all look identical. So it
doesn't seem to work...

++-+---+--
+
| id | username| email | password
|
++-+---+--
+
|  1 | admin   |   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
|  2 | test|   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
|  3 | qwerty  |   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
|  4 | yoo |   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
|  5 | zxcvbnm |   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
|  6 | ppp |   | 67452301efcdab8998badcfe10325476c3d2e1f0
|
++-+---+--
+

Alos durring the register for I get the following error: Warning:
Cannot modify header information - headers already sent by (output
started at /usr/home/ads/www/cake/cake/libs/view/view.php:308) in /usr/
home/ads/www/cake/cake/libs/controller/controller.php on line 441

I had this issue before. Usually it means I have some white space
somewhere... I copied the page from the browser as the file links
where giving invalid article... So I probably have awhite space. but
reading from the rror above I can't exactly see which file it is! Any
sugestions?

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



Multiple association to the same model.

2007-01-17 Thread Tazz

If anyone has been following my posts. I have been building a
"newsletter" for a record shop.

A break down of the models...

Releases: New record coming to the store.
Style: The type of music on the release.

Each release can have 1 to 5 styles.

I was thinking of creating my Releases model as follows...

Title
Price
Style1
Style2
Style3
...
Format
etc...

I suppose that is wrong... Is this a candidate for hasAndBelongsToMany?


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



Multiple associations for same model.

2007-01-17 Thread Tazz

One more think my record shop...

Each release may have multiple styles of music.

I wan' t to create the following columns on my release table: Style1,
Style2, Style3

And then create the proper associations.

Do you guys recommend another way? Although I prefer the above to make
the data entry easier.

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: Using conditions with recursive find

2007-01-16 Thread Tazz


Yep I got it working with bind/unbind. Defining all the associations in
the model before hand is nice "clean", but inefficient on the find
since it will return all data for all associations.

It would be interesting to be able to define a few associations in the
model and be able to pass the association name to the find methods.

Thanks


anselm wrote:

> Quick description of the domain/model...
>
> Working on a newsletter for a record shop...
>
> Models: Newsletter, Releases, Formats
>
> - Newsletter hasMany Releases
> - Released belongsTo Formats
>
> So basically a newsletter will display the new releases for the week
> and each release has a format such as: CD, Tape, Vinyl etc...
>
> Now I would like to split, the newsletter to only display all new
> releases on Vinyl format on the front page and the others on separate
> pages.
>
> How would I do this? Bind, unbind?

If you look in the chapter about associations
(http://manual.cakephp.org/chapter/models), you can see that an
association can have a name that is different from the classname --
that allows you to have different associations for the same table. For
each of the association you can then use the 'conditions' field to set
conditions particular to this association.

So for instance you have two associations in your NewsLetter model, one
for the vinyls and one for the other types :

var $hasMany = array(
  'VinylReleases' => array(
'className' => 'Release',
'conditions'  => 'Release.type = "vinyl"'
  ),
  'NonVinylReleases' => array(
'className' => 'Release',
'conditions' => 'Release.type <> "vinyl"'
  )
);

Now when you call

$this->NewsLetter->find(...);

This should return an array containing a field 'VinylReleases' and
another field 'NonVinylReleases' with the correct data in it.

You can add other terms to that condition -- it's SQL -- so you could
add an extra condition to get only the releases of a certain time
period. If this needs to be done on the fly, then, yes, use
bind/unbind.

Anselm



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



Grouping data?

2007-01-16 Thread Tazz


Can you pass the GROUP BY inside the $conditions field of an
association?

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



Using conditions with recursive find

2007-01-15 Thread Tazz


Quick description of the domain/model...

Working on a newsletter for a record shop...

Models: Newsletter, Releases, Formats

- Newsletter hasMany Releases
- Released belongsTo Formats

So basically a newsletter will display the new releases for the week
and each release has a format such as: CD, Tape, Vinyl etc...

Now I would like to split, the newsletter to only display all new
releases on Vinyl format on the front page and the others on separate
pages.

How would I do this? Bind, unbind?


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



Source of the bakery?

2007-01-08 Thread Tazz


Maybe this has been said before... Since the bakery is a complete
application done in cake, it would be nice to release it's code as
sample...

Or I'm I missing something? :p


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



I get a session warning. Any ideas?

2007-01-08 Thread Tazz


I get the below warnings when in debug mode 2... Is there any reason?
Should I even worry about it?


Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at
/usr/home/ads/www/cake/inbeat/controllers/components/pagination.php:492)
in /usr/home/ads/www/cake/cake/libs/session.php on line 146

Warning: Cannot modify header information - headers already sent by
(output started at
/usr/home/ads/www/cake/inbeat/controllers/components/pagination.php:492)
in /usr/home/ads/www/cake/cake/libs/session.php on line 147

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: Model associations and cascading delete.

2007-01-05 Thread Tazz


Yes, I meant the constraints as they appear in the SQL table
definition. You pretty much answered my question. I use MYSQL...

My model is ass follows...

1 Newsletter has many Releases (Albums)

1 Release (Album) has many songs.

When I delete a newsletter I want it to delete all associated albums
and songs.

When I delete a specific album I want it to delete all associated
songs.

Though it doesn't seem to work. I set my dependent = true on my hasMany
association but it doesn't seem to work. I don't have the code at hand
right now...


the_woodsman wrote:

A few basic things, such as naming conventions and primary keys, are
all you generally need in your DB.

"Do I also have to setup the constrains in my database?"

Do you mean 'constraints' as they appear in SQL table definitions?
If you're referring to SQL commands such as REFERENCES, ON DELETE
CASCADE, etc, CakePHP might be able to use them to understand table
relationships  - I don't  know, the databases I use don't support this
syntax.

However you generally achieve these associations between tables at the
PHP level, by creating a few variables in the right classes to define
what other tables are linked to this one, and what these relationships
are.
In fact, this is much more powerful than the features available
directly in SQL!



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



Model associations and cascading delete.

2007-01-04 Thread Tazz


Does Cake do all the work? Or do I also have to setup the constrains in
my database?

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

2006-12-29 Thread Tazz


Ok cool! I supose...

if(!user)
   redirect(to some page) or flash;

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



How to use dauth.

2006-12-28 Thread Tazz


Apart the tutorial on the bakery which demonstrates how to install the
component how do you use it to restrict access to some controllers and
views?

Bassically I'm creating a simple app that requires a one user login. I
just want to make sure that user is loged in before they can access
certain parts of the site...

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: Opinion: Best way to create data entry form

2006-12-26 Thread Tazz


Is there any more info on this component?

For instamce can I do a cycle back? To keep adding until finished?

stab wrote:

http://cakeforge.org/snippet/download.php?type=snippet&id=158

might be a start

On Dec 27, 2:08 am, "Tazz" <[EMAIL PROTECTED]> wrote:
> First I will describe my model and then present the way I see to create
> the data entry. I'm looking for a user friendly solution.
>
> I'm building an application for a record store so they can send out a
> weekly newsletter.
>
> The newsletter can have a blog entry and multiple record albums. Each
> record album can have multiple songs.
>
> So i was thinking of doing a wizard style data entry...
>
> 1- Create news letter with blog
> 2- Create album
> 3- Create and attach song to album
> 4- Cycle back to 2
> 5- Finish
>
> One thing was mentioned that there will never be more then 4-5 song per
> album so the I though to myself the album and song form can be one,
> where at the top you enter the album info and under you have 4-5 slots
> for the tracks! But I figure now I have to manually iterate through the
> form data to split everything up.



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



Opinion: Best way to create data entry form

2006-12-26 Thread Tazz


First I will describe my model and then present the way I see to create
the data entry. I'm looking for a user friendly solution.

I'm building an application for a record store so they can send out a
weekly newsletter.

The newsletter can have a blog entry and multiple record albums. Each
record album can have multiple songs.

So i was thinking of doing a wizard style data entry...

1- Create news letter with blog
2- Create album
3- Create and attach song to album
4- Cycle back to 2
5- Finish

One thing was mentioned that there will never be more then 4-5 song per
album so the I though to myself the album and song form can be one,
where at the top you enter the album info and under you have 4-5 slots
for the tracks! But I figure now I have to manually iterate through the
form data to split everything up.


--~--~-~--~~~---~--~~
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: (Error rendering Element: pagination). What could it be?

2006-12-20 Thread Tazz


Never mind figured it out!

Tazz wrote:

The component is working fine. I passed around different limits and
pages and the right data is displaying. Just that the pages wont
render...



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



(Error rendering Element: pagination). What could it be?

2006-12-20 Thread Tazz


The component is working fine. I passed around different limits and
pages and the right data is displaying. Just that the pages wont
render...


--~--~-~--~~~---~--~~
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 do i change default home page?

2006-12-19 Thread Tazz


$Route->connect('/', array('controller' => 'homes', 'action' =>
'display', 'index'));

Should be...

$Route->connect('/', array('controller' => 'homes', 'action' =>'index',
'index'));

display function does not exist in homes controller ;)

Thanks I have it all working now...


Mariano Iglesias wrote:

Yes, you can tell CakePHP that your controller doesn't use a model.

On your HomesController add the following variable:

var $uses = null;

Like so:

class HomesController extends AppController
{
var $uses = null;

function index()
{
$this->set('title', 'Home Page');
}
}

-MI

---

Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Tazz
Enviado el: MiƩrcoles, 20 de Diciembre de 2006 02:31 a.m.
Para: Cake PHP
Asunto: Re: How do i change default home page?


Humm when I create the HomesController, it then requires me do build
the Homes Model and then that requires an actual database table...

Is there a way so I can just create a home page and display different
data from different models regardless of their relation?



--~--~-~--~~~---~--~~
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 do i change default home page?

2006-12-19 Thread Tazz


Humm when I create the HomesController, it then requires me do build
the Homes Model and then that requires an actual database table...

Is there a way so I can just create a home page and display different
data from different models regardless of their relation?



Mariano Iglesias wrote:

Create a controller and an action. Let's say:

1. Create a file called app/controllers/homes_controller.php with the
following:

class HomesController extends AppController
{
function index()
{
$this->set('title', 'Home Page');
}
}

2. Create the view on file app/views/homes/index.thtml.

3. Edit app/config/routes.php and look for following line:

$Route->connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));

   Change it to:

$Route->connect('/', array('controller' => 'homes', 'action' =>
'display', 'index'));

After this your home page will be the index() action on your Homes
controller, so you can use your models there and stuff.

PS: I called the controller Homes instead of Home because as per CakePHP
recommendations controllers are to be plural.

-MI

---

Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Tazz
Enviado el: Lunes, 18 de Diciembre de 2006 03:10 a.m.
Para: Cake PHP
Asunto: How do i change default home page?


Please confirm if this is the right thing to do...

On my front page I want to show data from various models! Obviously,
the default home page created by the bake.php script is just a static
page...



--~--~-~--~~~---~--~~
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 do i change default home page?

2006-12-19 Thread Tazz


ok I think I got it now when I put the uses then it searched for that
particular model instead cool!

Mariano Iglesias wrote:

Create a controller and an action. Let's say:

1. Create a file called app/controllers/homes_controller.php with the
following:

class HomesController extends AppController
{
function index()
{
$this->set('title', 'Home Page');
}
}

2. Create the view on file app/views/homes/index.thtml.

3. Edit app/config/routes.php and look for following line:

$Route->connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));

   Change it to:

$Route->connect('/', array('controller' => 'homes', 'action' =>
'display', 'index'));

After this your home page will be the index() action on your Homes
controller, so you can use your models there and stuff.

PS: I called the controller Homes instead of Home because as per CakePHP
recommendations controllers are to be plural.

-MI

---

Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Tazz
Enviado el: Lunes, 18 de Diciembre de 2006 03:10 a.m.
Para: Cake PHP
Asunto: How do i change default home page?


Please confirm if this is the right thing to do...

On my front page I want to show data from various models! Obviously,
the default home page created by the bake.php script is just a static
page...



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



How do i change default home page?

2006-12-17 Thread Tazz

Please confirm if this is the right thing to do...

On my front page I want to show data from various models! Obviously,
the default home page created by the bake.php script is just a static
page...

I was thinking the folliwng...


Create a control called home, that controller will fill in the data
using the various models using the set() method within it's index
method, I will the create a view called home that view will pretty much
display the data I want.

Then I can pretty much configure the rootes to point to a different
home page right?

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: Good example for associations?

2006-12-14 Thread Tazz


John David Anderson (_psychic_) wrote:
> On Dec 14, 2006, at 11:46 AM, Tazz wrote:
>
> >
> > Is there any tutorials out there explaining how to use associations?
> >
> > I'm trying to do it strictly from the maual and I can't seem to get it
> > to work...
>
> How so?
>
> This should go without saying, but not providing any details makes it
> much harder to help out. :)
>
> -- John

lol you asked!

I get the following erro in my view: Warning: Invalid argument
supplied for foreach() in
/www/docs/ads.infected-rhythms.com/inbeat/app/views/albums/index.thtml
on line 15

If I unbind before calling findAll() my view is ok again.

To get an idea here is the link:
http://ads.infected-rhythms.com/inbeat/albums

Bassically here is the data model...

I have record albums and each record album has 1 genre associated to
it...

/*** tables **/

CREATE TABLE albums
(
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
genre_id INT  NOT NULL,
);

CREATE TABLE genres
(
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(20) NOT NULL
);

/*** models **/

class Album extends AppModel
{
var $name = 'Album';

var $hasOne = array('Genre' =>
array('className'=> 'Genre',
'conditions'   => '',
'order'=> '',
'dependent'=>  false,
'foreignKey'   => 'genre_id'
)
);

}

class Genre extends AppModel
{
var $name = 'Genre';

}

/*** controller **/

class AlbumsController extends AppController
{
var $name = 'Albums';

function index()
{
   // Put 1 att the end for recursive fetch.
   // If I use unbind here then I get no error, but then I
canot join to my genre table.
  $this->set('albums', $this->Album->findAll(null, null, null,
null, null, 1));
}

}

/*** view **/












Can anyone see what i'm doing wrong with my view? 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
-~--~~~~--~~--~--~---



Good example for associations?

2006-12-14 Thread Tazz

Is there any tutorials out there explaining how to use associations?

I'm trying to do it strictly from the maual and I can't seem to get it
to work...


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



Understanding model associations and the view.

2006-12-13 Thread Tazz

I started going through the tutorials and everything is fine. I can
enter data in the databse and display it. Now I would like to create an
association and display it.

But I get the following erro in my view: Warning: Invalid argument
supplied for foreach() in
/www/docs/ads.infected-rhythms.com/inbeat/app/views/albums/index.thtml
on line 15

If I unbind before calling findAll() my view is ok again.

To get an idea here is the link:
http://ads.infected-rhythms.com/inbeat/albums

Bassically here is the data model...

I have record albums and each record album has 1 genre associated to
it...

/*** tables **/

CREATE TABLE albums
(
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
genre_id INT  NOT NULL,
);

CREATE TABLE genres
(
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(20) NOT NULL
);

/*** models **/

class Album extends AppModel
{
var $name = 'Album';

var $hasOne = array('Genre' =>
array('className'=> 'Genre',
'conditions'   => '',
'order'=> '',
'dependent'=>  false,
'foreignKey'   => 'genre_id'
)
);

}

class Genre extends AppModel
{
var $name = 'Genre';
}

/*** controller **/

class AlbumsController extends AppController
{
var $name = 'Albums';

function index()
{
   // Put 1 att the end for recursive fetch.
   // If I use unbind here then I get no error, but then I
canot join to my genre table.
  $this->set('albums', $this->Album->findAll(null, null, null,
null, null, 1));
}
}

/*** view **/












Can anyone see what i'm doing wrong with my view? 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
-~--~~~~--~~--~--~---