Re: Avoiding binary data overwrite when updating model...

2006-11-12 Thread Dr. Tarique Sani

On 11/13/06, Daniel Jewett <[EMAIL PROTECTED]> wrote:
> Looking at:
> Model::save (
> $data = null,
> $validate = true,
> $fieldList = array()
> )

>From the API docs - array   $fieldList List of fields to allow to be 
>written

HTH
Tarique

-- 
=
PHP Applications for E-Biz: http://www.sanisoft.com
Coppermine Picture Gallery: http://coppermine.sf.net
=

--~--~-~--~~~---~--~~
 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: Avoiding binary data overwrite when updating model...

2006-11-12 Thread Bert Van den Brande

In the fieldlist you can put a list of fields the query is allowed to update.
So in your case, remove the 'image' field from the whitelist when the
image data is empty

On 11/13/06, Daniel Jewett <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> I have a form for Model 'Item' that includes a file upload widget to
> get image data into a database. When I want to edit the data, how can
> I avoid having the binary data overwritten if the file upload is
> empty (null)? In other words if I'm not replacing the image I don't
> want the update to erase it.
>
> Looking at:
> Model::save (
> $data = null,
> $validate = true,
> $fieldList = array()
> )
>
> Thanks,
> Dan J.
>
>
>
> >
>

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



Avoiding binary data overwrite when updating model...

2006-11-12 Thread Daniel Jewett

Hello all,

I have a form for Model 'Item' that includes a file upload widget to  
get image data into a database. When I want to edit the data, how can  
I avoid having the binary data overwritten if the file upload is  
empty (null)? In other words if I'm not replacing the image I don't  
want the update to erase it.

Looking at:
Model::save (
$data = null,
$validate = true,
$fieldList = array()
)

Thanks,
Dan J.



--~--~-~--~~~---~--~~
 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: Need freelance help with cakephp project

2006-11-12 Thread Olwen Williams

How much work is involved?  I've done some work with cake.

On 13/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I need some assistance with a new project based on cakePHP.  It is a
> small web application that must be developed in the new few weeks.
>
> Please respond to this post with contact information if you are
> interested and have time to devote to completing this application in 2
> to 3 weeks.
>
> The successful completion of the project could lead to more work as the
> project grows.
>
>
> >
>

--~--~-~--~~~---~--~~
 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: Cake PHP Vs Prado Vs Symfony

2006-11-12 Thread Bert Van den Brande

I've been using both Cake and Symfony at the same time, and I think
they are both great frameworks with some up- and downsides attached,
which may not even be downsides or upsides depending on your point of
view.

Typically, it's all a matter of requirements and preferences ... while
I believe it's true that Cake is great for quick development, I feel
more comfortable with Symfony for a bigger project.

Stating that Symfony is trying to 'lure' app developers into using it
seems like sort of a negative remark that it don't deserves, as I do
find for myself that Cake is missing some extensive documentation.
To be practical: when coding in Symfony I have the Symonfy
documentation in .pdf open all the time, and some quick searches
usually lead me to the correct info in a matter of seconds. With Cake,
I need to figure out the correct section of the online manual, and
then most of the time I need to go to the google groups and hope to
find some proper documented answers.

As for the ORM part I am a strong supporter of Propel for years, but I
also see the power of the Cake approach where lots of query results
are at instantly available. One should of course take into
consideration the extra load Propel-usage puts onto your application @
runtime, where on the other hand Cake is very lightweight.

Cake's approach to convention over configuration is very good, and I
also tend to dislike dozens of configuration files all over the place
like you will have with Symfony. On a downside, Cake's documentation
lacks some convention info which often has cost me valuable time
trying to find out the reason for some behavior.

So in the end, as I said, it's all a matter of requirements and
preferences, and deciding what's best for your project ...

--~--~-~--~~~---~--~~
 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: Need freelance help with cakephp project

2006-11-12 Thread nate

You have two available venues for these requests:

http://cakefoundation.org/pages/services
http://cakebaker.42dh.com/


--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Eric

yes. the $posts contains data. Cause I use  to get
data already.


--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
Code looks good. If you're sure that the $posts contains any content, I really don't know what's wrong.IMHO, it's something with the database and/or the findAll statement. You can also try decomposing the problem into which part of Cake (the model, view, or controller).
My first step would be checking out that $posts variable by adding debug($posts); line on the view.On 11/13/06, Eric <
[EMAIL PROTECTED]> wrote:- /app/views/layouts the file rss.thtml---
  I paste itfrom the tutorial--PostsController-class PostsController extends AppController{//var $scaffold;var $name = 'Posts';
function index() {$this->Post->recursive = 0;$this->set('posts', $this->Post->findAll());}function rss()   {$this->layout = 'rss';
$this->set('posts', $this->Post->findAll("","","modified DESC", // Sort order2 // Number to be returned));   }
---rss.thtml--vendor("feedcreator.class");$rss = new UniversalFeedCreator();$rss->title = "my title";$rss->description = "my description";
$rss->link = "my link";$rss->syndicationURL = "my syndication url";// Initialize the cssStyleSheet var, needed to avoid an error withFeedCreator version 1.7.2-mod (latest version at time of writing)
$rss->cssStyleSheet = "";foreach ($posts as $post){$item = new FeedItem();$item->title = $post['Post']['title'];$item->link = "link";
$item->description = $post['Post']['body'];$newdate = $post['Post']['created'];list($date,$hours) = split(' ', $newdate);list($year,$month,$day) = split('-', $date);list($hour,$min,$sec) = split(':', $hours);
$date = date("r", mktime($hour, $min, $sec, $month, $day,$year));$item->date = $date;$item->source = "source";$item->author = "author";
$rss->addItem($item);}$rss->saveFeed();?>Thanks-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador

--~--~-~--~~~---~--~~
 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: Changing theme

2006-11-12 Thread Dr. Tarique Sani

On 11/12/06, Eric <[EMAIL PROTECTED]> wrote:
> I am quite confused about the whole process.
No problems

> OK. When the page opend, it fetchs the config.theme from the db, like
> modern, and then pass it to the Theme.php to handle the rest of the
> thing ?

Yes ThemeView will handle the rest automagically

> Is the Theme.php just jump in to 'load' the theme by users?

Yes

> I am just newbie. Wanna to know more and clear.

I was a newbie too not very long ago ;)

My best suggestion now would be to try and use ThemeView in your
application - when you run into problems ask more questions.

> Thanks. The cheese is really cheese. It contains lots of function. A
> excenllent sample about how to use Cake.

Thanks - that is an encouragment to make cheesecake even better

Cheers
Tarique

-- 
=
PHP Applications for E-Biz: http://www.sanisoft.com
Coppermine Picture Gallery: http://coppermine.sf.net
=

--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Eric

- /app/views/layouts the file rss.thtml---  I paste it
from the tutorial




--PostsController-
Post->recursive = 0;
$this->set('posts', $this->Post->findAll());
}


function rss()
   {
$this->layout = 'rss';
$this->set('posts', $this->Post->findAll("","",
"modified DESC", // Sort order
2 // Number to be returned
));
   }

---rss.thtml--

title = "my title";
$rss->description = "my description";
$rss->link = "my link";
$rss->syndicationURL = "my syndication url";
// Initialize the cssStyleSheet var, needed to avoid an error with
FeedCreator version 1.7.2-mod (latest version at time of writing)
$rss->cssStyleSheet = "";


foreach ($posts as $post)
{
$item = new FeedItem();
$item->title = $post['Post']['title'];
$item->link = "link";
$item->description = $post['Post']['body'];
$newdate = $post['Post']['created'];
list($date,$hours) = split(' ', $newdate);
list($year,$month,$day) = split('-', $date);
list($hour,$min,$sec) = split(':', $hours);
$date = date("r", mktime($hour, $min, $sec, $month, $day,
$year));
$item->date = $date;
$item->source = "source";
$item->author = "author";

$rss->addItem($item);
}

$rss->saveFeed();
?>
 

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: ERROR_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
I can't really help you without the code... Coz I think it's in the code.Also check your findAll statement, maybe it's empty because there is no data being passed.On 11/13/06, 
Eric <[EMAIL PROTECTED]> wrote:
Thank for your patient!I also do the tutorial said...and I also do your way change the$rss->outputFeed();to $rss->saveFeed();I have save the feed by my FF, and it appeard in my bookmarks Toolbar
folder. BUT, It contains nothingDon't know why...-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador

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


Need freelance help with cakephp project

2006-11-12 Thread [EMAIL PROTECTED]

I need some assistance with a new project based on cakePHP.  It is a
small web application that must be developed in the new few weeks.

Please respond to this post with contact information if you are
interested and have time to devote to completing this application in 2
to 3 weeks.

The successful completion of the project could lead to more work as the
project grows.


--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Eric

Thank for your patient!

I also do the tutorial said...and I also do your way change the
$rss->outputFeed();
to $rss->saveFeed();

I have save the feed by my FF, and it appeard in my bookmarks Toolbar
folder. BUT, It contains nothing

Don't know why...


--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
Can you post the code? Mine's working well based on the tutorial.On 11/12/06, Eric <[EMAIL PROTECTED]> wrote:
Thanks Buddy...BUT, I just can create a rss by browser like
http://localhost/cake/posts/rssAnd I can add it for my FF2.0BUT it is contains nothing...Why?-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador

--~--~-~--~~~---~--~~
 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: Multi-page form validation

2006-11-12 Thread mariano.iglesias

Sounds like a very cool thing to show the rest: how to implement a
wizard in cake.

Possibly a Bakery article? ;)


--~--~-~--~~~---~--~~
 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 can I add a dynamic header to all pages

2006-11-12 Thread mariano.iglesias

Why don't you mix it? Create a component that handles the logic to
obtain the data that should be available on all views. Then add that
component to $components in your AppController. Then, on the
beforeRender() method of your AppController interact with your
component and finally set the data for the views with $this->set().


--~--~-~--~~~---~--~~
 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: my first association

2006-11-12 Thread igor

gobblez wrote:
> This is a summary of my DB tables and fields:
>
> users
> ---
> id | email | password | group_id | created | modified
>
> groups
> -
> id | name | created | modified
>
> User.php
> 
> class User extends AppModel
> {
> // Its always good practice to include this variable.
> var $name = 'User';
> var $hasOne = array('Group' =>
I think this association should be changed in belongsTo instead of
hasOne?

>   'foreignKey'   => 'user_id'
Anyway, where is the user_id in any of mentioned tables?
I thinks this is wrong. There is no foreign key for the table groups.

> Group.php
> --
> class Group extends AppModel
This sounds ok to me ;)

Please read here:
http://manual.cakephp.org/chapter/models
Section 4 : Associations


--~--~-~--~~~---~--~~
 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 add header to all pages

2006-11-12 Thread pieceofcakephp

first,
put this code to your header template:
//---
renderElement('zone_header'); ?>
//---
this code will call "app/views/elements/zone_header.thtml"

inside "zone_header.thtml" put another code:
//---
requestAction("zones/dynamicheader",array('return'));?>
//---
this code will call as a regular url action submit to you website as
"http://yourdomain.org/zones/dynamicheader";, so you must create your
controller "zones", model "zone", and view
"app/views/zones/dynamicheader.thtml".

Now is up to you, how many model you want to use in your model and how
you control your data in your class ZonesController -> method /
function "dynamicheader()".

Regards,

Widi Harsojo.



On Nov 13, 1:36 am, "devarz" <[EMAIL PROTECTED]> wrote:
> How can I add a dynamic header to all pages?
>
> If I create a header template I can include it in all views, but I
> don't know how to go about including the data handling routine to all
> the controllers.
>
> Can I create a dedicated controller for this and let all other
> controllers inherit from it? Or should I create a component handling
> this logic?


--~--~-~--~~~---~--~~
 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: Multi-page form validation

2006-11-12 Thread Ismael S. Kafeltz

I made a website with 11 steps with some 30 tables
A little complex, if you need some help email me.

devarz escreveu:

> I am trying to implement a multi-page form with validation for each
> step.
>
> Where do I put the validation rules? There are some rather complex
> rules in the form, and some branching depending on the choices the user
> make. That means that I need to validate the form for each step, but
> using a subset of the totals of rules required to submit the complete
> form.
>
> Should I make a model for each step in the form, perhaps inheriting
> from a parent model where all fields for all pages are present?
> 
> Help 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: How to add header to all pages

2006-11-12 Thread devarz

OK, looks like what I am after is the app_controller.php file. I want
to display some statistics, name of the user etc in the header. The
rest of the page should be displayed if the user is authorized to view
the particular section (as set by ACL) Only if not authorized at all,
should the user be redirected to a login page.

I thought I could give Cake a try to see if I could find an elegant way
of handling the abovementioned scenario.


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



Multi-page form validation

2006-11-12 Thread devarz

I am trying to implement a multi-page form with validation for each
step.

Where do I put the validation rules? There are some rather complex
rules in the form, and some branching depending on the choices the user
make. That means that I need to validate the form for each step, but
using a subset of the totals of rules required to submit the complete
form.

Should I make a model for each step in the form, perhaps inheriting
from a parent model where all fields for all pages are present?

Help 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: my first association

2006-11-12 Thread SuperBeing

This has something to do with your relationships. Can you post your
model code somewhere I can have look,

Steve

gobblez wrote:
> I've been reading the manual and have been trying to get the obAuth
> working that I found in the Bakery.  I have "Users", and they can
> belong to one "Group".  Then a "Group" can have many "Users".
>
> This is a summary of my DB tables and fields:
>
> users
> ---
> id | email | password | group_id | created | modified
>
> groups
> -
> id | name | created | modified
>
>
> My problem is when I do a findAll() on the User model, it will least
> each user like it should, but it pairs the Group up with the same "id",
> and not "group_id".  In other words, user with "id" of 2 will have
> group with an "id" of 2, totally ignoring what the "group_id" defines
> for that user.
>
> When I reverse the search, and findAll() by Group, it will list the
> groups, but return zero user's associated with the groups.
>
>
> I've tried multiple variations of the foreignKey, dot syntax, just have
> "id", switching between 'user_id' and 'group_id' in both models, and so
> on.  What's weird is when I deleted the $hasOne and  $hasMany code from
> them, it still worked the same.  So I dunno what to do.


--~--~-~--~~~---~--~~
 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: obAuth errors

2006-11-12 Thread SuperBeing

What's the name of your User model and $this->user_model should be the
name of that model.

So if you have a User model called "User" then var $user_model should =
"User"


--~--~-~--~~~---~--~~
 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 add header to all pages

2006-11-12 Thread Mikee Freedom

I guess it depends on what kind of data it is going to be.

Logic specific to an action
- in the action of the controller

Logic specific to a model
- in one of the callback methods of the model controller
- e.g. beforeRender, beforeFilter, etc

Logic that you need to include on every view
- in one of the callback methods of the app_controller.php file

If any of this doesn't make sense let me know and I'll point you in
the right direction i.e. some additional reading.

cheers,
mikee

On 13/11/06, devarz <[EMAIL PROTECTED]> wrote:
>
> That makes a lot of sense, the only problem is that I don't know where
> to put the *code* responsible for gathering the data that goes in the
> header. Where can I place code, so that it gets executed in all
> controllers (or a subset) in my app?
>
> Thanks for your reply!
>
>
> >
>

--~--~-~--~~~---~--~~
 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 add header to all pages

2006-11-12 Thread devarz

That makes a lot of sense, the only problem is that I don't know where
to put the *code* responsible for gathering the data that goes in the
header. Where can I place code, so that it gets executed in all
controllers (or a subset) in my app?

Thanks for your reply!


--~--~-~--~~~---~--~~
 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 add header to all pages

2006-11-12 Thread Mikee Freedom

I'm not sure exactly what you mean, but if this sounds like it could
work for you it has done wonders for me so far.

Borrowed the concept from WordPress in a way. In my layout I check for
the existence of a variable called $header, if it exists I output it,
if it doesn't I do nothing.

This way, if any of my controllers need to pass header information I
can include it quickly and easily without the hassle.

Does this make sense?

Cheers,
mikee

On 13/11/06, devarz <[EMAIL PROTECTED]> wrote:
>
> How can I add a dynamic header to all pages?
>
> If I create a header template I can include it in all views, but I
> don't know how to go about including the data handling routine to all
> the controllers.
>
> Can I create a dedicated controller for this and let all other
> controllers inherit from it? Or should I create a component handling
> this logic?
>
>
> >
>

--~--~-~--~~~---~--~~
 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 add header to all pages

2006-11-12 Thread devarz

How can I add a dynamic header to all pages?

If I create a header template I can include it in all views, but I
don't know how to go about including the data handling routine to all
the controllers.

Can I create a dedicated controller for this and let all other
controllers inherit from it? Or should I create a component handling
this logic?


--~--~-~--~~~---~--~~
 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: Best practice for CSS

2006-11-12 Thread leamas

Thanks!  
I really appreciate the help. :)


--~--~-~--~~~---~--~~
 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 Theme your cakephp apps.

2006-11-12 Thread Eric

Someone post a new article about this in the new Barkery??

Thanks


"nate 写道:
"
> What's showing in the wiki is really all there is to it.  You set the
> theme name in the controller, and all images, JavaScript and CSS are
> automatically loaded from that subdirectory in webroot.  (Btw, this
> feature has been implemented for some time now, the wiki page is old.)


--~--~-~--~~~---~--~~
 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: Associations without using foreign key?

2006-11-12 Thread Grant Davies

 Luigi,

The join table which is the 'extra' table is a common practice and good
design principle in when working with databases, when you say it seems
like unnecessary work, how will you stop someone inserting a record in
your blog favorites that has no relationship to the blog posts table,
you would it in code, but if you have a join table that has foreign keys
to the two tables you an configure the database to not allow an unknown
key to be inserted, this gives you DATA INTEGRITY which is a key part of
a well developed application.  So your code could attempt to keep things
clean and consistent but your DB will not allow records with unmatched
keys to be inserted.

I'd suggest reading the book "Database Design for Mere Mortals" for a
good idea on well defined schemas.  

Cheers
Grant

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Luigi
Sent: Saturday, November 11, 2006 10:24 PM
To: Cake PHP
Subject: Associations without using foreign key?


Hi all,

Is there anyway to specify a hasMany or belongsTo association that
doesn't use a foreign key? I have two tables:

blog_posts: id, author_id, title, text
blog_favorites: id, user_id, author_id

The idea of blog_favorites is that every user can choose a few favorite
authors, and the blog_posts can be queried based on the match between
author_id's. However, there are no foreign key available for an
association, because in both tables the author_id isn't the primary key.
It seems like I would have to build an association through a separate
author table, but that just seems like unnecessary work.

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



Need some suggestions for medium sized application

2006-11-12 Thread RedShift

Hello

(sorry if I posted twice, it didn't show up the first time :\)

Ok, so, I'm developing a medium sized application. I would appreciate
any suggestions you guys can make.

I need to design a system that traces microstations. What's a
microstation?
Just for reference, a microstation is a septic tank.

A microstation consists out of 2 or 3 tanks. A tank is manufactured by
a
_producer_. Then the tanks are assembled by an _assembler_ to create a
microstation. Now that microstation is then imported by an _importer_,
which
basically assigns a microstation to an _installer_. That same
_installer_
is able to keep a maintenance log (but that's for later).

So we have the following:
* Producer: produces tanks, the system registeres tank number,
production date,
and some other caracteristics.
* Assembler: takes the available tanks and assembles them into a
microstation.
The system registeres which tanks have been used to assemble it, a
production
number, the assembly date, etc...
* Importer: has an overview of available microstations. He assigns a
microstation an installer.
* Installer: has an overview of microstations assigned to him, he
assigns
microstations to a customer (system registeres customer name, address,
etc...)

First of all, the system is seperated in 5 different classes. That's
because
there are 5 types of users. They all have different views when they
login.
You have:

* Businessunit
* Producer
* Assembler
* Importer
* Installer

What's the businessunit? Well he is god. He is able to see
*everything*. That's
the point of the system, it provides tracing of the elements defined
earlier.
He can see for example, which microstation importer x has assigned to
installer
y.

Here's my current database:

* identities
- id (int auto_increment)
- class (set(businessunit, producer, assembler, importer, installer,
customer))
- name (varchar)
- password (varchar(32))
- address
- zip
- region
- country

* tanks
- id (int auto_increment)
- nr varchar(6)
- production (date)
- volume (int)
- identity_id

* microstations
- id (int auto_increment)
- nr (varchar(8))
- assembly (date)
- type (varchar(10))
- loading (date)

* microstations_tanks
- id (int auto_increment)
- microstation_id
- tank_id

* assignments
- id (int auto_increment)
- microstation_id
- identity_id

How does this look like for you guys?

Now my final question; every class of user, has a total different
system.
For example, when a producer logs in, he sees the tanks that he has
produced,
and can add new ones. When an assembler logs in, he sees the
microstations that
he has assembled, and can add new ones. When an importer logs in, he
only sees
available microstations and can assign an installer. When an installer
logs in
he can only see microstations assigned to him.
How would I do this with cakephp? Create a new "application" for every
class
of user?

If you have any comments, no matter how small, please do post them!
Just about
anything is usefull.

Thanks for your time

Glenn


--~--~-~--~~~---~--~~
 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 can I add a dynamic header to all pages

2006-11-12 Thread devarz

How can I add a dynamic header to all pages?

If I create a header template I can include it in all views, but I
don't know how to go about including the data handling routine to all
the controllers.

Can I create a dedicated controller for this and let all other
controllers inherit from it? Or should I create a component handling
this logic?


--~--~-~--~~~---~--~~
 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: adding helper

2006-11-12 Thread Andrej

Meek,
you are right.
At least I get familiar with inheritance model in cakephp.
Thanks,
a.


--~--~-~--~~~---~--~~
 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: does othAuth work with Ajax ??

2006-11-12 Thread bingo

Hi CraZyLegs,

two issues:
First, the article was removed from the bakernot sure why...but I
was able to get access through google cache

I copied the code and replaced it with previous OthAuth component...but
now website completely stopped loading..I used firebug ..and is not
giving any error

Do I have make changes somewhere ??

Regards


--~--~-~--~~~---~--~~
 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: does othAuth work with Ajax ??

2006-11-12 Thread CraZyLeGs

0.2 had some issues with ajax I think which naonak solved in a comment
at othy.wordpress.com
use the latest othAuth version 0.5 at the bakery

On 12 nov, 05:17, "bingo" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have been using othAuth for my authentication system. Till now it
> worked perfectly...but as I am implementing ajax functionality, othAuth
> is giving some trouble.
>
> othAuth fails to check for authentication when the request is made
> using ajax. Did anyone else faced similar problem or I am missing
> something in my code...
> 
> let me know possible mistakes
> 
> Regards,
> bingo


--~--~-~--~~~---~--~~
 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: adding helper

2006-11-12 Thread meek

Hi,
Your solution shouldn't be necessary.
Cake merges $helper, $component and even $uses arrays automatically.
So if you have ...
var $helpers = array('Html','Javascript');
... in your AppController, and ...
var $helpers = array('MyHelper');
... in your child controller, then all three Helpers will be available
in your child controller's views. You should watch out with case
though, the names of the helpers in these arrays should always be
capitalized.



Andrej schrieb:

> As I've got solution I post it to community.
> According to http://www.php.net/manual/en/keyword.parent.php it's
> impossible to access parent variables using parent::
> The only way to access parent variable is _not_ to use same variable
> name in derived class.
>
> So I put a new variable into my custom Controller and wrote constructor
> to merge helper definition arrays.
>
> app_controller.php:
>  class AppController extends Controller {
>   var $helpers = array('html','javascript');
> }
> ?>
>
> controllers/investors_controller.php:
>  class InvestorsController extends AppController {
>   var $extendHelpers = array('Child', 'Contact');
>   function __construct(){
>   parent::__construct();
>   $this->helpers = array_merge($this->helpers, 
> $this->extendHelpers);
>   }
> }
> ?>


--~--~-~--~~~---~--~~
 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: adding helper

2006-11-12 Thread Andrej

As I've got solution I post it to community.
According to http://www.php.net/manual/en/keyword.parent.php it's
impossible to access parent variables using parent::
The only way to access parent variable is _not_ to use same variable
name in derived class.

So I put a new variable into my custom Controller and wrote constructor
to merge helper definition arrays.

app_controller.php:


controllers/investors_controller.php:
helpers = array_merge($this->helpers, 
$this->extendHelpers);
}
}
?>


--~--~-~--~~~---~--~~
 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: adding helper

2006-11-12 Thread Andrej



On Nov 11, 8:55 pm, "Andrej" <[EMAIL PROTECTED]> wrote:
> in AppController I've got two default helpers:
>
> var $helpers = array('html','javascript');
>
> in EmployeesController I want to use another helper, the Child helper.
> It is possible by typing:
>
> var $helpers = array('Html', 'Javascript', 'Child');
>
> Question is:
> when I add 'scriptaculous' helper into AppController, do I have to
> update all my controllers and add 'scriptaculous' to all helpers or
> there is some way to just extend default helper array?
> 
> Thanks in advance,
> a.


--~--~-~--~~~---~--~~
 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: Multiple functions/views at once?

2006-11-12 Thread [EMAIL PROTECTED]

One further point. If a single view (here exemplified by an html page)
consists of several different, perhaps only loosely related visual
sections, I suggest that its controller's function  should consists
largely of calls to a number of routines which prepare the data
packages for each of those visual sections.

I guess those routines should be elements if they are expected to be
reused by other controllers. Otherwise I imagine they should just be
support functions, presumably controller methods.


--~--~-~--~~~---~--~~
 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: Multiple functions/views at once?

2006-11-12 Thread [EMAIL PROTECTED]

Synchro wrote:
> I expect a page to be the result of many functions
> displaying many views at once. ... Do I
> need to build layout back-ends in my controllers in order to call
> multiple functions and gather relevant views together? But that makes a
> controller do a view's job as presentation structure ends up in
> controller logic...

I don't see that preparing data and getting them ready for presentation
is "a view's job." I think it's exactly a controller's job, that of
moving information from model(s) to view(s). Certainly a model can't do
that, as it's responsible to be a well from which one can call up some
category of data in a specified array format.

A controller and each of its views are inextricably linked by the
particular controller function specifically built to support a
particular view. The division between controller function and view is
not well defined, except that the view is supposed to be a largely rote
visual specialist while the controller is intended as an active
information collector.

Experience shows that the whole ensemble is easier to create and modify
if the controller does everything which cannot be concisely
accomplished within the view's visual structure.

At least, that's my own perspective on the matter. It is ready to be
corrected by others who have spent more time in this neck of the woods.


--~--~-~--~~~---~--~~
 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: Changing theme

2006-11-12 Thread Eric

I am quite confused about the whole process.

OK. When the page opend, it fetchs the config.theme from the db, like
modern, and then pass it to the Theme.php to handle the rest of the
thing ?

Like normal way, m-v-c, I understand some. The View display for forend,
like input, and all layout. Of course, we can modify the file in foler
layout to do some customerize.

BUT, I dont clear about the theme thing. As you said, if I choose the
theme like modern, it doesn't contain any files, css, it will back to
display the normal way.

Is the Theme.php just jump in to 'load' the theme by users?

I am just newbie. Wanna to know more and clear.

Thanks. The cheese is really cheese. It contains lots of function. A
excenllent sample about how to use Cake.





"Dr. Tarique Sani 写道:
"
> On 11/12/06, Eric <[EMAIL PROTECTED]> wrote:
>  > BUT, I dont know how to relate the theme and just use it.
> >
> > Can U explain it futhure more ?
>
> Take a look at the code of ThemeView at
>
> https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/cheesecake/views/theme.php?rev=218&root=cheesecake&view=markup
>
> Specially line
>
> $this->theme =& $controller->theme;
>
> This is what is needed - In cheesecake we set this via the
> $controller->theme which in turn is set in the appInit component.  If
> this feels complicated then
>
> $this->theme = "yourthemename" ;
>
> Hard coded will also work - so it is up to your code as to how it sets
> the value of $this->theme in ThemeView and it will work
>
> Cheers
> Tarique
>
>
> --
> =
> PHP Applications for E-Biz: http://www.sanisoft.com
> Coppermine Picture Gallery: http://coppermine.sf.net
> =


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



Stupid situation

2006-11-12 Thread [EMAIL PROTECTED]

So in devploment stage i have cake directories

/andriu/cake - witch cake core
/andriu/beta/, /andri/beta/webroot - witch app (controlers,models etc,
httacces)

i use $html->link(..) to create html code on web pages exp.

in apache alias beta.lowcy.pl > /andriu/beta

echo $html->link('home','/homes'); // http://beta.lowcy.pl/homes";>


and all is ok, but not when i rename beta to lowcy

/andriu/cake - witch cake core
/andriu/lowcy/, /andri/lowcy/webroot - witch app (controlers,models
etc, httacces)

in apache domain lowcy.pl > /andriu/lowcy

echo $html->link('home','/homes'); // http://beta.lowcy.pl/webroot/homes";>

why function link generate bad url witch /webroot/ ??


--~--~-~--~~~---~--~~
 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_Adding an RSS feed using FeedCreator

2006-11-12 Thread Eric

Thanks Buddy...

BUT, I just can create a rss by browser like
http://localhost/cake/posts/rss

And I can add it for my FF2.0 

BUT it is contains nothing...Why?


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