Re: Advanced image manipulation in Cake? (cropping, resizing)

2007-09-10 Thread Erich C. Beyrent

I use a helper for image manipulation.  A simple example would be:

Html->link($this->Html->image($file, array('border' 
=> '0')), '/', null, null, false);
} // End Function

function resize($path, $width, $height, $aspect = true, 
$htmlAttributes = array(), $return = false)
{
   // Resize logic here

   // Return the image
   return $this->output(sprintf($this->Html->tags['image'], 
$relfile, $this->Html->parseHtmlOptions($htmlAttributes, null, '', ' 
')), $return);
}

// Add other manipulation functions here
}
?>

In your view, you can do:

resize($image, 135, 124, false, array('alt'=>'my 
resized image', 'border'=>1, 'hspace'=>4));?>

HTH

-Erich-


Olexandr Melnyk wrote:
> Check out ImageMagick (not CakePHP plugin, but a powerful set of tools)
> 
> On 9/9/07, *d'plus* <[EMAIL PROTECTED] > wrote:
> 
> 
> Is there any helper/script for cropping and resizing images in
> realtime?
> 
> 
> I'm trying to adapt this script http://www.ajaxprogrammer.com/?p=9 to
> work with my website, but without success, so I'm trying to find
> something diffrent :(
> 
> 
> 
> 
> 
> -- 
> Sincerely yours,
> Olexandr Melnyk
> http://omelnyk.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: New to Cake

2007-07-19 Thread Erich C. Beyrent

Can you connect to the database via the console using that username and
password?  Did you add permissions to the database for that user?

-Erich-

Chris Hartjes wrote:
> On 7/19/07, Bob <[EMAIL PROTECTED]> wrote:
>> Thank you.
>>
>> Tried that. Same result, same errors.
>>
>> Bob
> 
> Well, I'm pretty sure that when PHP is saying that it can't connect to
> the database server, it's being honest.  I would triple check that the
> username and password you are using are correct.  That's the only
> possible explanation given the error message.
> 

--~--~-~--~~~---~--~~
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: URL issue

2007-05-09 Thread Erich C. Beyrent

I am sorry I was not clear - I don't need to construct the URL from Cake 
- I need Cake to HANDLE this URL.

I specify the URL, the vendor generates an email containing the link, 
Joe Smith receives the email and clicks on the link.

I was thinking about parsing out the URL in index.php and reconstructing 
the bits into the format that Cake expects, but it seems like such a hack.

Is there something I can do with rewrite rules instead to reformat the url?


Felix Geisendörfer wrote:
> Not really a CakePHP specific question. But today is your lucky day. A) 
> I'm looking for any kind of excuse to not study for my physics final 
> tomorrow. B) I like playing with array, regex and urls : ).
> 
> So here you go:
> ---
> $vendorUrl = 
> toStupidVendorUrl('http://servername.com/resorts/view/12/28/4');
> debug($vendorUrl);
> 
> function toStupidVendorUrl($url)
> {
> $uri = parse_url($url);
> $path = explode('/', substr($uri['path'], 1));
> $query = array();
> foreach ($path as $i => $element)
> {
> $i = ife($i == 0, null, $i);
> $query['var'.$i] = $element;
> }
> $query = http_build_query($query);
> return 
> preg_replace('/^('.preg_quote($uri['scheme']).':\/\/.+\/).+$/UD', 
> '\\1?'.$query, $url);
> }
> -----------
> (Code requires CakePHP or PHP5)
> 
> -- Felix
> --
> http://www.thinkingphp.org
> http://www.fg-webdesign.de
> 
> 
> Erich C. Beyrent wrote:
>> I have a vendor that is doing email marketing for me.  They allow custom 
>> fields to be specified in their content templates.  However, they don't 
>> support full urls as a custom field, only parts of the query string.
>>
>> I am sending them a URL like:
>>
>> http://servername.com/resorts/view/12/28/4
>>
>> and they need me to break that into:
>>
>> http://servername.com/?var=resorts&var2=view&var3=12&var4=28&var5=4
>>
>> Any ideas how to accomplish this?
>>
>> -Erich-
>>
>>
>>
>>
>>   
> 
> > 

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



URL issue

2007-05-09 Thread Erich C. Beyrent

I have a vendor that is doing email marketing for me.  They allow custom 
fields to be specified in their content templates.  However, they don't 
support full urls as a custom field, only parts of the query string.

I am sending them a URL like:

http://servername.com/resorts/view/12/28/4

and they need me to break that into:

http://servername.com/?var=resorts&var2=view&var3=12&var4=28&var5=4

Any ideas how to accomplish this?

-Erich-


--~--~-~--~~~---~--~~
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: Consuming web services in CakePHP

2007-05-07 Thread Erich C. Beyrent

I build web service clients and servers with NuSOAP - you'll need to 
make sure you get the latest version out of CVS.

Basically, you would do something like:

vendor('nusoap');

$strWSDL = 'http://www.someurl.com/path/to/wsdl';
$client = new nusoap_client($strWSDL, true);
$proxy = $client->getProxy();

$proxy->call('somemethod', $args);

And off you go.

-Erich-


Samuel DeVore wrote:
> no a problem in 5.x versions of php you'll be able to leverage
> http://us.php.net/soap
> 
> in 4.x you will probably want to use something like nusoap
> 
> http://dietrich.ganx4.com/nusoap/
> 
> On 5/4/07, dasiel <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I'm working in a project and I need to use web services but I don't
>> know how web services are consumed  in Cake, the  web services are
>> based on SOAP and they are developed in .NET I don't know if this
>> could be a problem. Thanx a lot. Excuse me my english.
>>
>>
> 
> 

--~--~-~--~~~---~--~~
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: DreamHost and CakePHP?

2007-04-05 Thread Erich C. Beyrent

I've got a few sites on Dreamhost and had no problems.

-Erich-

neospirit wrote:
> Hi all,
> 
> Anyone here currently host CakePHP site with DreamHost? Any issues on
> deploying CakePHP site?
> 
> I'd really appriciate any info shared here. I plan to use their service.
> 
> Regards,
> Uwie
> 
> 
> > 

--~--~-~--~~~---~--~~
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: Proposal for "killer app"

2007-03-28 Thread Erich C. Beyrent

But in your example, they are developing for Wordpress and Drupal. 
Applied to this project proposal, they'd be developing for the CMS 
itself, not for CakePHP.

-Erich-

digital spaghetti wrote:
> Fair enough on the Basecamp point, but I was looking at an overall
> general app that end-users can use, and Basecamp is quite specific to
> people who need Groupware.
> 
> However I have to disagree on your other points.  Look at Drupal or
> Wordpress for example, they are aimed at the end user - but as a
> consiquence of this, you have many hundreds of developers adding new
> code and features to them every day.  Why can't this be the same for
> CakePHP.
> 
> And I think if we are to persuade people to develop for CakePHP there
> should be something there other than a few basic tutorials to show
> them what its capible off.
> 
> If you bake it, they will come!
> 
> Tane
> 
> On 3/28/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>> On 3/28/07, digital spaghetti <[EMAIL PROTECTED]> wrote:
>>>
>>> What I believe CakePHP needs is a killer app, a CMS that can rival the
>>> others out there, and that gives people the chance to actually see
>>> cakephp in action.  Think of it as a pre-packed Cake you get in the
>>> supermarket.  RoR has one, Radient CMS - why can't we?  I think by NOT
>>> having one, that scares a lot of people off.
>>>
>> The killer app for Rails is Basecamp, not Radient CMS.  Rails, in
>> fact, grew out of extractions from the creation of Basecamp.
>>
>> Trivial nitpicking aside, I fail to understand how a "killer app" for
>> CakePHP is going to lead more developers to start using CakePHP
>> instead of Zend Framework or Symfony.  We are aiming at *developers*
>> not *users*.
>>
>> PHP suffers from being considered "lame" by the latest generation of
>> web developers, who tout Python and Ruby as the only good scripting
>> languages for the web.  Never mind that several of the biggest web
>> applications out there use PHP (Yahoo! ring a bell?).
>>
>> To steal a phrase from Microsoft, it's all about "developers,
>> developers, DEVELOPERS!!!".  We (as in the community using CakePHP)
>> need to find constructive ways to convince developers to use CakePHP.
>>
>> --
>> Chris Hartjes
>>
>> My motto for 2007:  "Just build it, damnit!"
>>
>> rallyhat.com - digital photo scavenger hunt
>> @TheBallpark - http://www.littlehart.net/attheballpark
>> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>>
> 
> > 

--~--~-~--~~~---~--~~
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: Bakery Article

2007-03-26 Thread Erich C. Beyrent


Forbidden

TICKET_CREATE privileges are required to perform this operation

TracGuide — The Trac User and Administration Guide


gwoo wrote:
> Please submit bug reports to https://trac.cakephp.org/newticket.
> 
> 
> > 

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



Bakery Article

2007-03-26 Thread Erich C. Beyrent

I am trying to add a new article to the Bakery, but there are no 
categories.  The article cannot be submitted without a category, so I'm 
stuck.

Can the person/people who maintain the Bakery take a look at this?

-Erich-

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

2007-02-15 Thread Erich C. Beyrent

I ran out of time to try Cake-like solutions, so I ended up using the 
dirty $this->State->query() method.

-Erich-

Christopher E. Franklin, Sr. wrote:
> I'm sorry that I am not able to test this at work at the moment, I am
> swamped.  Did you make any headway?
> 
> On Feb 11, 6:25 pm, "Erich C. Beyrent" <[EMAIL PROTECTED]>
> wrote:
>> Your suggestions are great, but sadly, I've already tried combinations
>> of a blank foreign key as well as a foreign key of 'id'.
>>
>> Example row from the states table:
>>
>> +--+---+-+
>> |id|name   |code |
>> +--+---+-+
>> |10|new hampshire  |nh   |
>> +--+---+-+
>>
>> Example row from the registered_states table:
>>
>> +--+
>> | state_id |
>> +--+
>> | 10   |
>> +--+
>>
>> -Erich-
>>
>> Christopher E. Franklin, Sr. wrote:
>>
>>> Well, it sounds good but, I always try to follow the K.I.S.S. method:
>>> Keep It Simple Stupid.
>>> I think the point now is not whether it is the "right way" or "wrong
>>> way" but, rather, why is it not working...  if you or we can figure
>>> this out and post our findings, I think we would both be better coders
>>> for it.
>>> Give me an example row from each database and I will test out your
>>> code at work tomorrow.
>>> One thing I did notice about your hasMany array:
>>> from the example, this code:
>>> >> class User extends AppModel
>>> {
>>> var $name = 'User';
>>> var $hasOne = array('Profile' =>
>>> array('className'=> 'Profile',
>>>   'conditions'   => '',
>>>   'order'=> '',
>>>   'dependent'=>  true,
>>>   'foreignKey'   => 'user_id'
>>> )
>>>   );
>>> }
>>> ?>
>>> Outputs an array like:
>>> Array
>>> (
>>> [User] => Array
>>> (
>>> [id] => 25
>>> [first_name] => John
>>> [last_name] => Anderson
>>> [username] => psychic
>>> [password] => c4k3roxx
>>> )
>>> [Profile] => Array
>>> (
>>> [id] => 4
>>> [name] => Cool Blue
>>> [header_color] => aquamarine
>>> [user_id] = 25
>>> )
>>> Notice the foreign key.  Let's say that user = registered_state and
>>> profile = state.  Profile has a column with user_id.  You are using
>>> state_id as your foreignKey yet, your table for state does not have a
>>> state_id... just an id.  Try changing that foreign key for me to
>>> either blank or just id.
>>> )
>>> --Chris
>>> On Feb 11, 5:28 pm, "Erich C. Beyrent" <[EMAIL PROTECTED]>
>>> wrote:
>>>> I had added the belongsTo association to the states table, and that
>>>> didn't make a difference - I got the same results.
>>>> Here's what I am trying to accomplish - visitors to the website must
>>>> select their state of residency to continue, and that state needs to be
>>>> validated against a list of registered states.
>>>> In my current schema, I can accomplish the results I am looking for with
>>>> this query:
>>>> select code from states right join registered_states on
>>>> registered_states.state_id = states.id
>>>> This would give me a list like NH, MA, CT, RI, VT.
>>>> I am looking for a way to do this through model associations and the
>>>> findAll method.
>>>> I know that I could also accomplish this by adding an isRegistered field
>>>> to the states table with a value of 1 or 0, and then query on that.
>>>> Perhaps that is simply the easiest solution.
>>>> Like I said, I know that I can use a custom query, but that seems
>>>> hackish when considering the capabilities of Cake.
>>>> Any ideas?
>>>> -Erich-
>>>> Christopher E. Franklin, Sr. wrote:
>>>>> If I am not mistaken, I believe the State mo

Re: Associations trouble

2007-02-11 Thread Erich C. Beyrent

Your suggestions are great, but sadly, I've already tried combinations 
of a blank foreign key as well as a foreign key of 'id'.

Example row from the states table:

+--+---+-+
|id|name   |code |
+--+---+-+
|10|new hampshire  |nh   |
+--+---+-+

Example row from the registered_states table:

+--+
| state_id |
+--+
| 10   |
+--+

-Erich-

Christopher E. Franklin, Sr. wrote:
> Well, it sounds good but, I always try to follow the K.I.S.S. method:
> Keep It Simple Stupid.
> 
> I think the point now is not whether it is the "right way" or "wrong
> way" but, rather, why is it not working...  if you or we can figure
> this out and post our findings, I think we would both be better coders
> for it.
> 
> Give me an example row from each database and I will test out your
> code at work tomorrow.
> 
> One thing I did notice about your hasMany array:
> 
> from the example, this code:
> 
>  class User extends AppModel
> {
> var $name = 'User';
> var $hasOne = array('Profile' =>
> array('className'=> 'Profile',
>   'conditions'   => '',
>   'order'=> '',
>   'dependent'=>  true,
>   'foreignKey'   => 'user_id'
> )
>   );
> }
> ?>
> 
> Outputs an array like:
> 
> Array
> (
> [User] => Array
> (
> [id] => 25
> [first_name] => John
> [last_name] => Anderson
> [username] => psychic
> [password] => c4k3roxx
> )
> 
> [Profile] => Array
> (
> [id] => 4
> [name] => Cool Blue
> [header_color] => aquamarine
> [user_id] = 25
> )
> 
> Notice the foreign key.  Let's say that user = registered_state and
> profile = state.  Profile has a column with user_id.  You are using
> state_id as your foreignKey yet, your table for state does not have a
> state_id... just an id.  Try changing that foreign key for me to
> either blank or just id.
> )
> 
> --Chris
> 
> On Feb 11, 5:28 pm, "Erich C. Beyrent" <[EMAIL PROTECTED]>
> wrote:
>> I had added the belongsTo association to the states table, and that
>> didn't make a difference - I got the same results.
>>
>> Here's what I am trying to accomplish - visitors to the website must
>> select their state of residency to continue, and that state needs to be
>> validated against a list of registered states.
>>
>> In my current schema, I can accomplish the results I am looking for with
>> this query:
>>
>> select code from states right join registered_states on
>> registered_states.state_id = states.id
>>
>> This would give me a list like NH, MA, CT, RI, VT.
>>
>> I am looking for a way to do this through model associations and the
>> findAll method.
>>
>> I know that I could also accomplish this by adding an isRegistered field
>> to the states table with a value of 1 or 0, and then query on that.
>> Perhaps that is simply the easiest solution.
>>
>> Like I said, I know that I can use a custom query, but that seems
>> hackish when considering the capabilities of Cake.
>>
>> Any ideas?
>>
>> -Erich-
>>
>> Christopher E. Franklin, Sr. wrote:
>>
>>> If I am not mistaken, I believe the State model has to have an
>>> association with RegisteredState model as well to get that backwards
>>> compatibility.  Take a look at the user and profile models in this
>>> example.
>>> http://manual.cakephp.org/chapter/models
>>> If you notice, User hasOne Profile while Profile belongsTo User.
>>> There is a definition in both models to get the expected return and
>>> association.
>>> I don't know exactly what you are trying to accomplish but, if you do
>>> a hasAndBelongsToMany, don't forget to make the Join table with the
>>> name registered_states_states and just have two columns, one with
>>> registered_state_id and the other with state_id.
>>> Tell me if this helps you any or, you can post back with what exactly
>>> you are trying to do and how you envision the relationship between
>>> state and registered_state.  Are they sort of "tags&q

Re: Associations trouble

2007-02-11 Thread Erich C. Beyrent

I had added the belongsTo association to the states table, and that 
didn't make a difference - I got the same results.

Here's what I am trying to accomplish - visitors to the website must 
select their state of residency to continue, and that state needs to be 
validated against a list of registered states.

In my current schema, I can accomplish the results I am looking for with 
this query:

select code from states right join registered_states on 
registered_states.state_id = states.id

This would give me a list like NH, MA, CT, RI, VT.

I am looking for a way to do this through model associations and the 
findAll method.

I know that I could also accomplish this by adding an isRegistered field 
to the states table with a value of 1 or 0, and then query on that. 
Perhaps that is simply the easiest solution.

Like I said, I know that I can use a custom query, but that seems 
hackish when considering the capabilities of Cake.

Any ideas?

-Erich-

Christopher E. Franklin, Sr. wrote:
> If I am not mistaken, I believe the State model has to have an
> association with RegisteredState model as well to get that backwards
> compatibility.  Take a look at the user and profile models in this
> example.
> 
> http://manual.cakephp.org/chapter/models
> 
> If you notice, User hasOne Profile while Profile belongsTo User.
> There is a definition in both models to get the expected return and
> association.
> 
> I don't know exactly what you are trying to accomplish but, if you do
> a hasAndBelongsToMany, don't forget to make the Join table with the
> name registered_states_states and just have two columns, one with
> registered_state_id and the other with state_id.
> 
> Tell me if this helps you any or, you can post back with what exactly
> you are trying to do and how you envision the relationship between
> state and registered_state.  Are they sort of "tags" as in State:
> Open, Closed? or Something else?
> 
> In all, the only problem I can see right now with your code is you do
> not have the backwards association in the State model.  Try belongsTo.
> 
> On Feb 11, 10:21 am, "Erich C. Beyrent" <[EMAIL PROTECTED]>
> wrote:
>> Here are my tables:
>>
>> CREATE TABLE `registered_states` (
>>`state_id` int(11) NOT NULL default '0',
>>PRIMARY KEY  (`state_id`)
>> ) ENGINE=MyISAM DEFAULT CHARSET=latin1
>>
>> CREATE TABLE `states` (
>>`id` int(11) NOT NULL auto_increment,
>>`name` varchar(24) NOT NULL default '',
>>`code` char(2) NOT NULL default '',
>>PRIMARY KEY  (`id`)
>> ) ENGINE=MyISAM DEFAULT CHARSET=latin1
>>
>> Models:
>>
>> // registered_state.php
>> class RegisteredState extends AppModel
>> {
>> var $name = 'RegisteredState';
>>
>> var $hasMany = array('State' =>
>>   array('className' => 'State',
>> 'conditions'=> '',
>> 'order' => '',
>> 'limit' => '',
>> 'foreignKey'=> 'state_id',
>> 'dependent' => false,
>>         'exclusive' => false,
>> 'finderQuery'   => ''
>>   )
>>);
>>
>> }
>>
>> // state.php
>> class State extends AppModel
>> {
>>  var $name = 'State';
>>  var $validates = array('code' => VALID_NOT_EMPTY);
>>
>> }
>>
>> -Erich-
>>
>> Christopher E. Franklin, Sr. wrote:
>>
>>> Post your model code with the names of the files and where they are
>>> located.
>>> On Feb 10, 6:12 pm, "Erich C. Beyrent" <[EMAIL PROTECTED]>
>>> wrote:
>>>> That did not work - now I get:
>>>> Array
>>>> (
>>>>  [0] => Array
>>>>  (
>>>>  [RegisteredState] => Array
>>>>  (
>>>>  [state_id] => 10
>>>>  )
>>>>  [State] => Array
>>>>  (
>>>>  )
>>>>  )
>>>> )
>>>> I know I can write my own custom query

Re: Associations trouble

2007-02-11 Thread Erich C. Beyrent

Here are my tables:

CREATE TABLE `registered_states` (
   `state_id` int(11) NOT NULL default '0',
   PRIMARY KEY  (`state_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `states` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(24) NOT NULL default '',
   `code` char(2) NOT NULL default '',
   PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1


Models:

// registered_state.php
class RegisteredState extends AppModel
{
var $name = 'RegisteredState';

var $hasMany = array('State' =>
  array('className' => 'State',
'conditions'=> '',
'order' => '',
'limit' => '',
'foreignKey'=> 'state_id',
'dependent' => false,
'exclusive' => false,
'finderQuery'   => ''
  )
   );


}

// state.php
class State extends AppModel
{
 var $name = 'State';
     var $validates = array('code' => VALID_NOT_EMPTY);


}


-Erich-

Christopher E. Franklin, Sr. wrote:
> Post your model code with the names of the files and where they are
> located.
> 
> On Feb 10, 6:12 pm, "Erich C. Beyrent" <[EMAIL PROTECTED]>
> wrote:
>> That did not work - now I get:
>>
>> Array
>> (
>>  [0] => Array
>>  (
>>  [RegisteredState] => Array
>>  (
>>  [state_id] => 10
>>          )
>>
>>  [State] => Array
>>  (
>>  )
>>
>>  )
>> )
>>
>> I know I can write my own custom query for this, but I am unsure as to
>> why this isn't working for me.
>>
>> -Erich-
>>
>> djiize wrote:
>>> in registered_states table, try state_id (not plural)
>>> On 9 fév, 19:10, "Erich C. Beyrent" <[EMAIL PROTECTED]> wrote:
>>>> I am trying to link two tables, states and registered_states.
>>>> The states table has id, name, and code as fields, and registered_states
>>>> has states_id.
>>>> I defined as hasMany association in the registered_states model, and now
>>>> want to produce a list of all the registered states and their associated
>>>> state.
>>>> I'm getting the list of registered states, but no state data:
>>>> Array
>>>> (
>>>>  [0] => Array
>>>>  (
>>>>  [RegisteredState] => Array
>>>>  (
>>>>  [states_id] => 10
>>>>  )
>>>>  [State] => Array
>>>>  (
>>>>  )
>>>>  )
>>>> )
>>>> What I'm particularly interested in retrieving is the state code for
>>>> each registered state.
>>>> How can I accomplish this?
>>>> -Erich-
> 
> 
> > 

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

2007-02-10 Thread Erich C. Beyrent

That did not work - now I get:

Array
(
 [0] => Array
 (
 [RegisteredState] => Array
 (
 [state_id] => 10
 )

 [State] => Array
 (
 )

 )
)

I know I can write my own custom query for this, but I am unsure as to 
why this isn't working for me.

-Erich-

djiize wrote:
> in registered_states table, try state_id (not plural)
> 
> On 9 fév, 19:10, "Erich C. Beyrent" <[EMAIL PROTECTED]> wrote:
>> I am trying to link two tables, states and registered_states.
>>
>> The states table has id, name, and code as fields, and registered_states
>> has states_id.
>>
>> I defined as hasMany association in the registered_states model, and now
>> want to produce a list of all the registered states and their associated
>> state.
>>
>> I'm getting the list of registered states, but no state data:
>>
>> Array
>> (
>>  [0] => Array
>>  (
>>  [RegisteredState] => Array
>>  (
>>  [states_id] => 10
>>  )
>>
>>  [State] => Array
>>  (
>>  )
>>
>>  )
>> )
>>
>> What I'm particularly interested in retrieving is the state code for
>> each registered state.
>>
>> How can I accomplish this?
>>
>> -Erich-
> 
> 
> > 

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



Associations trouble

2007-02-09 Thread Erich C. Beyrent

I am trying to link two tables, states and registered_states.

The states table has id, name, and code as fields, and registered_states 
has states_id.

I defined as hasMany association in the registered_states model, and now 
want to produce a list of all the registered states and their associated 
state.

I'm getting the list of registered states, but no state data:

Array
(
 [0] => Array
 (
 [RegisteredState] => Array
 (
 [states_id] => 10
 )

 [State] => Array
 (
 )

 )
)

What I'm particularly interested in retrieving is the state code for 
each registered state.

How can I accomplish this?

-Erich-

--~--~-~--~~~---~--~~
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: why use jQuery instead of Prototype

2007-02-08 Thread Erich C. Beyrent

This article specifically is pretty good:

http://borkweb.com/story/the-ajax-experience-jquery-toolkit

-Erich-

fredBH wrote:
> hi everyone!
> 
> im going to start develop and im see some guys using jquery... others
> using normal ajax cake prototype... and i just wanna know what the
> diference of them...
> I had searched about jquery but i dont understand how can it change
> about ajax call from Prototype...
> 
> Can someone help showing me what do some uses jquery e some uses
> Prototype ?
> Articles... Tutorials... anything helpfull...
> 
> Thx a lot guys
> bye
> 
> 
> > 

--~--~-~--~~~---~--~~
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: why use jQuery instead of Prototype

2007-02-08 Thread Erich C. Beyrent

Check out http://www.borkweb.com and http://www.nosheep.net - search for 
jquery and you'll find a bunch of examples.

HTH

-Erich-

fredBH wrote:
> hi everyone!
> 
> im going to start develop and im see some guys using jquery... others
> using normal ajax cake prototype... and i just wanna know what the
> diference of them...
> I had searched about jquery but i dont understand how can it change
> about ajax call from Prototype...
> 
> Can someone help showing me what do some uses jquery e some uses
> Prototype ?
> Articles... Tutorials... anything helpfull...
> 
> Thx a lot guys
> bye
> 
> 
> > 

--~--~-~--~~~---~--~~
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: Existing Projects

2007-01-26 Thread Erich C. Beyrent

Well, for instance, tables that have a primary key of ID instead of id, 
or perhaps even UserID.  It's the modeling of the database that concerns 
me - what I need to do to get the models to work.

Devraj Mukherjee wrote:
> Hi Eric,
> 
> What do you mean by existing database which has a schema and doesn't
> conform to to what CakePHP is expecting?
> 
> As far I understand CakePHP introspects the database to figure out
> what fields (variables) it should have.
> 
> On 1/27/07, Erich C. Beyrent <[EMAIL PROTECTED]> wrote:
>> CakePHP is a wonderful framework if you are starting from scratch.
>> Every example and tutorial I have seen uses freshly minted database tables.
>>
>> But how easy is it to layer CakePHP on top of an existing database which
>> has a schema that doesn't conform to what CakePHP is expecting?  Is it
>> possible to use CakePHP in this manner, or will I have to define all the
>> queries manually?
>>
>> Anyone have any case studies to share on this topic?
>>
>> -Erich-
>>
> 
> 

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



Existing Projects

2007-01-26 Thread Erich C. Beyrent

CakePHP is a wonderful framework if you are starting from scratch. 
Every example and tutorial I have seen uses freshly minted database tables.

But how easy is it to layer CakePHP on top of an existing database which 
has a schema that doesn't conform to what CakePHP is expecting?  Is it 
possible to use CakePHP in this manner, or will I have to define all the 
queries manually?

Anyone have any case studies to share on this topic?

-Erich-

--~--~-~--~~~---~--~~
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: htaccess issues

2007-01-24 Thread Erich C. Beyrent

I have searched both the google group and google itself.  I also have 
all three htaccess files, and CakePHP works wonderfully until I try to 
use the custom-built version of php in conjunction with the AddHandler 
and Action directives.  I've tried placing these extra lines in each 
seperate htaccess file, and I've tried placing them in all three.

I'm kind of at a loss as to how to solve this issue.

-Erich-


Samuel DeVore wrote:
> I'll assume that you have searched the google group
> 
> <http://groups.google.com/group/cake-php/search?group=cake-php&q=10+internal+redirects&qt_g=Search+this+group>
> 
> (see if the absolute paths trick works)
> 
> and have searched google
> 
> <http://www.google.com/search?q=cakephp%2010%20internal%20redirects>
> 
> Make sure you made changes to all three of the .htaccess files and
> also you might ask dreamhost, I know there are a number of people here
> who are using them to host cakephp sites (I am one but am using the
> standard php stuff from them)
> It could be the cgi method being used for php as well and that might
> be another search vector you could try
> 
> Sam D
> 
> On 1/24/07, Erich C. Beyrent <[EMAIL PROTECTED]> wrote:
>> Second post - any takers? This may be off-topic:
>>
>> I am running my cakephp application on Dreamhost, with PHP 5.1.2.
>> Everything works beautifully.
>>
>> However, the version of PHP installed does not have soap support built
>> in, so Dreamhost provides instructions how to recompile PHP and use this
>> custom version.  Their instructions are to add the following to the
>> .htaccess file:
>>
>> AddHandler phpFive .php
>> Action phpFive /cgi-bin/php.cgi
>>
>> When I do this, I get the following errors in the Apache log file:
>>
>> Request exceeded the limit of 10 internal redirects due to probable
>> configuration error. Use 'LimitInternalRecursion' to increase the limit
>> if necessary. Use 'LogLevel debug' to get a backtrace.
>>
>> I'm really not sure as to a)how to diagnose this issue; b) how to fix
>> this issue.
>>
>> Are there any .htaccess gurus here that have perhaps seen this before,
>> and know how to solve it in reference to the default cakephp rewrite rules?
>>
>> -Erich-
>>
>>
>>
>>
> 
> 

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



htaccess issues

2007-01-24 Thread Erich C. Beyrent

Second post - any takers? This may be off-topic:

I am running my cakephp application on Dreamhost, with PHP 5.1.2.
Everything works beautifully.

However, the version of PHP installed does not have soap support built
in, so Dreamhost provides instructions how to recompile PHP and use this
custom version.  Their instructions are to add the following to the
.htaccess file:

AddHandler phpFive .php
Action phpFive /cgi-bin/php.cgi

When I do this, I get the following errors in the Apache log file:

Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use 'LimitInternalRecursion' to increase the limit
if necessary. Use 'LogLevel debug' to get a backtrace.

I'm really not sure as to a)how to diagnose this issue; b) how to fix
this issue.

Are there any .htaccess gurus here that have perhaps seen this before,
and know how to solve it in reference to the default cakephp rewrite rules?

-Erich-




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



.htaccess issue

2007-01-22 Thread Erich C. Beyrent

This may be off-topic:

I am running my cakephp application on Dreamhost, with PHP 5.1.2. 
Everything works beautifully.

However, the version of PHP installed does not have soap support built 
in, so Dreamhost provides instructions how to recompile PHP and use this 
custom version.  Their instructions are to add the following to the 
.htaccess file:

AddHandler phpFive .php
Action phpFive /cgi-bin/php.cgi

When I do this, I get the following errors in the Apache log file:

Request exceeded the limit of 10 internal redirects due to probable 
configuration error. Use 'LimitInternalRecursion' to increase the limit 
if necessary. Use 'LogLevel debug' to get a backtrace.

I'm really not sure as to a)how to diagnose this issue; b) how to fix 
this issue.

Are there any .htaccess gurus here that have perhaps seen this before, 
and know how to solve it in reference to the default cakephp rewrite rules?

-Erich-


--~--~-~--~~~---~--~~
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: File upload with AJAX

2007-01-03 Thread Erich C. Beyrent


Maybe this will help:

http://seemysites.net/projFolder/uploader/


Ámon Tamás wrote:


[EMAIL PROTECTED] wrote:


AJAX itself can't handle file upload. It's a big no no apparently and a
security hazard if it was allowed...however, what goes on is there is
an iframe and the file upload takes place there within that form.


Ok. I know, this is not an easy thing, but I like a site to work it 
because it is look like very cool (:) and I like to know how it is work 
really. I stolled the code from Drupal, but it is very big and not easy 
to understand it. (And this is written with jquery, but it is not a big 
problem.)


I only want to know how I can send a file to the server (with AJAX or 
JavaScript) and How I can get back the response from this iframe. I 
don't want any progress bar and other feature, only this. But when try 
to find tutorials howtos everything speaking about progress-bars, what 
is not very interesting for me now.




There are several tutorials on this, TJSinglton linked one there,
here's another: http://seemysites.net/projFolder/uploader/
Ok. I take a look in it (Uber-Uploader, but I think this is not what I 
want).


and if you need further info, use my custom search engine on my blog:
http://www.concepthue.com/blog
to read more about the whole thing, I have several pages I included
with info on this as I was just working with this a few weeks ago.

In the endand after getting it to work...I decided not to use it
lol, but hopefully this will be of some 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: Group by?

2006-12-13 Thread Erich C. Beyrent

That worked like a charm - it didn't even occur to me to try that!  I'm 
still getting used to this framework, and it's really cool to be able to 
do stuff like this.

Thanks for the assist!

-Erich-

AD7six wrote:
> On Dec 11, 4:12 am, "Erich C. Beyrent" <[EMAIL PROTECTED]>
> wrote:
>> This insight is truly helpful, however, my associations are a little
>> different.
>>
>> I have an Offer which belongs to a resort.  A Resort belongs to both a
>> State and a Destination, and hasMany Offers.  Both States and
>> Destinations hasMany Resorts.  There is also a secondary association
>> between Resorts and States where a Resort can be associated with many
>> states.
>>
>> What I am trying to do is a findAll on my Specials, but have them
>> grouped by Destination.
> 
> So in other words you don't want a GROUP BY at all ;).
> 
> // Use unbindModel to get rid of unneeded associations before running
> // Use bindModel to define any associations or constraints on the
> associated models.
> $results =
> $this->Offer->Resort->Destination->findAll($DestinationAndOrResortConstraint,null,'Destination.name
> ASC',null,null,2);
> pr ($results); die;
> 
> That should get you a step closer. The array will of course be a
> different structure from doing a find on offer, but the results will be
> approx. what you are looking for.
> 
> HTH,
> 
> AD7six
> Please note:
> The manual/bakery is a good place to start any quest for info.
> The cake search (at the time of writing) erroneously reports less/no
> results for the google group.
> The wiki may contain incorrect info - read at your own risk (it's
> mainly user submitted) :) You may get your answer quicker by asking on
> the IRC Channel (you can access it with just a browser
> here:http://irc.cakephp.org).
> 
> 
> > 

--~--~-~--~~~---~--~~
 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: Group by?

2006-12-10 Thread Erich C. Beyrent

This insight is truly helpful, however, my associations are a little 
different.

I have an Offer which belongs to a resort.  A Resort belongs to both a 
State and a Destination, and hasMany Offers.  Both States and 
Destinations hasMany Resorts.  There is also a secondary association 
between Resorts and States where a Resort can be associated with many 
states.

What I am trying to do is a findAll on my Specials, but have them 
grouped by Destination.

As I have things working right now, the findAll gives me back all of the 
data that I require; I just don't know how to do the group by in the 
query.  I can always do the grouping after the fact in PHP, but I'd 
rather have this done by the database, as it's the most logical place to 
do it.

Models are as follows:

class Offer extends AppModel
{
var $name = 'Offer';
var $recursive = 2;

var $belongsTo = array('Resort' => array('className'  => 'Resort',
  'conditions' => '',
  'order'  => '',
  'foreignKey' => 'resort_id'
 ));
}

class Resort extends AppModel
{
var $name = 'Resort';
var $belongsTo = array('State' => array('className'  => 'State',
 'conditions' => '',
 'order'  => '',
 'foreignKey' => 'state_id'
  ),
  'Destination' => array('className' => 'Destination',
 'conditions' => '',
 'order'  => '',
 'foreignKey' =>'destination_id'
)); 

var $hasMany = array('Offer' =>
  array('className' => 'Offer',
'conditions'=> 'Offer.isActive = 1',
'order' => 'Offer.created DESC',
'limit' => '',
'foreignKey'=> 'resort_id',
'dependent' => true,
'exclusive' => false,
'finderQuery'   => ''
  )
   );   


var $hasAndBelongsToMany = array('States' => array('className' => 
'State',
  'joinTable'=> 'resorts_states',
  'foreignKey'   => 'resort_id',
  'associationForeignKey'=> 'state_id',
  'conditions'   => '',
  'order'=> '',
  'limit'=> '',
  'unique'   => true,
  'finderQuery'  => '',
  'deleteQuery'  => '',
 ));


-Erich-


AD7six wrote:
> 
> On Dec 9, 1:32 am, "Mariano Iglesias" <[EMAIL PROTECTED]>
> wrote:
>> You could use a custom query:
>>
>> $this->Model->findAll('GROUP BY field', null, null);
>>
>> Or you could also use this method:
>>
>> http://groups-beta.google.com/group/cake-php/browse_thread/thread/20f7b0dda
> 
> Hi All,
> 
> After an hour or two bugging Nate (muchisimus thankius) and trying to
> figure out why in one circ I couldn't get this to work, here is some
> distilled info:
> 
> If you want to include some aggreagate info from a hasMany associated
> model, first of all use bind Model to create a dummy hasOne association
> so that the model is part of the query.
> 
> Bear in mind that for a simple select (SELECT blah FROM tables WHERE $x
> ORDER BY $y LIMIT $z), $x is the conditions and depends on what you
> pass (obvisously):
> 
> where you pass an array constraint you will get:
> (First array element) AND (second array element). As such the approach
> mentioned in the link may not work.
> 
> where you pass a string constraint:
> "Model.field = value" will give you "SELECT blah FROM tables WHERE
> Model.field = value ORDER BY.."
> Therefore
> "GROUP BY x.y" will give you "SELECT blah FROM tables WHERE GROUP BY
> x.y ORDER BY.." Which isn't syntactically correct
> BUT
> "1=1 GROUP BY x.y" will give you "SELECT blah FROM tables WHERE 1=1
> GROUP BY x.y ORDER BY.." Which is correct
> 
> Be aware that if you have a hasOne or belongsTo association that has a
> condition, you will need to 'integrate' this condition into your find
> conditions, and remove it from the association (with bindModel) to
> avoid getting "WHERE (String Constraint including GROUP BY) AND
> (association condition) ORDER BY.."
> 
> Here's a working example:
> $this->Blog->bindModel(array('hasOne'=>array('Dummy'=>array('className

Group by?

2006-12-08 Thread Erich C. Beyrent

Where do you specify "group by" clauses in your model?  Is there a way, 
or do I need to write a custom query?

-Erich-

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



othAuth problem

2006-12-06 Thread Erich C. Beyrent

I am sure I am just missing something in my othAuth configuration, but 
when I hit a restricted page and attempt to enter my credentials, I get 
the following error:

Fatal error: Call to a member function on a non-object in 
/app/controllers/components/oth_auth.php on line 116

And the code that corresponds to this line is:

$row = $this->controller->{$this->user_model}->find($conditions);

Has anyone come across this, and/or know how to fix it?

-Erich-


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



othAuth problem

2006-12-05 Thread Erich C. Beyrent

I am sure I am just missing something in my othAuth configuration, but 
when I hit a restricted page and attempt to enter my credentials, I get 
the following error:

Fatal error: Call to a member function on a non-object in 
/app/controllers/components/oth_auth.php on line 116

And the code that corresponds to this line is:

$row = $this->controller->{$this->user_model}->find($conditions);

Has anyone come across this, and/or know how to fix it?

-Erich-

--~--~-~--~~~---~--~~
 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: Warning: htmlspecialchars() - selectTag HABTM

2006-11-29 Thread Erich C. Beyrent

I experienced the same issue, but refreshed the page and the error went 
away.  It was really bizarre.

-Erich-


Mariano Iglesias wrote:
> This seems like a Bug. Can you report it on the track?
> 
>  
> 
> Follow instructions here:
> 
>  
> 
> https://trac.cakephp.org/wiki/bugreport
> 
> -MI
> 
> ---
> 
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
> 
> BAKE ON!
> 
> 
> 
> *De:* cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] *En 
> nombre de *Aldemir Vieira
> *Enviado el:* Miércoles, 29 de Noviembre de 2006 01:16 p.m.
> *Para:* cake-php@googlegroups.com
> *Asunto:* Warning: htmlspecialchars() - selectTag HABTM
> 
>  
> 
> Hi,
> 
> I have problem with relateds (selectTag) HABTM in my (thtml), but when 
> use scaffold, the problem does not happen.
> :
> 
> *Warning*: htmlspecialchars() expects parameter 1 to be string, array 
> given in *..\htdocs\[approot]\cake\basics.php* on line *558*
> 
> 
> > 

--~--~-~--~~~---~--~~
 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: Default layout and controllers

2006-11-17 Thread Erich C. Beyrent

I had tried that approach.  What happens is that the view sees the 
variable without a problem, but not the default layout.  It's almost 
like I need to pass the variable to the controller that handles the 
layout to set.

-Erich-

Grant Cox wrote:
> I think the problem to #1 is that you have
> if(isset($this->offerTitle)){
> instead of
> if( !isset($this->offerTitle) ){
> 
> 
> But the best way to do it would be to have in your controller
> $this->set('offerTitle', 'Test Promotion');
> 
> and in your layout
> print ''.$offerTitle.'';
> 
> 
> > 

--~--~-~--~~~---~--~~
 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: Default layout and controllers

2006-11-16 Thread Erich C. Beyrent

I figured out the missing images problem by using the $html->image helper...

-Erich-

Erich C. Beyrent wrote:
> I have a few questions that perhaps you can help me with.
> 
> 1.  I have created a default layout, contains a masthead block that I 
> want to display different things, depending on the controller.  So, in 
> my default layout, I have:
> 
>  if(isset($this->offerTitle)){
>   print 'Site Name';
>   }
>   else
>   {
>   print ''.$this->offerTitle.'';
>   }
>   ?>
> 
> And in one of my controllers, I have:
> 
> $this->offerTitle = 'Test Promotion';
> 
> However, I always get a notice-level warning from PHP that the variable 
> doesn't exist, and I can't seem to set this variable.  I also tried 
> $this->set('offerTitle', 'Test Promotion');
> 
> So my question is, how can I set dynamic data from my controllers and 
> have the correct data displayed in my default layout?
> 
> 2.  I seem to be getting different renders depending on where in the app 
> I am.  For example, on the home section, everything looks as it should, 
> yet when I go into a different section, I seem to be missing an image 
> block at the top of the page.
> 
> The offending links are as follows:
> 
> http://resortscope.com/devel/cms/index.php
> http://resortscope.com/devel/cms/offers/test
> 
> Any tips would be greatly appreciated!
> 
> -Erich-
> 
> > 

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



Default layout and controllers

2006-11-16 Thread Erich C. Beyrent

I have a few questions that perhaps you can help me with.

1.  I have created a default layout, contains a masthead block that I 
want to display different things, depending on the controller.  So, in 
my default layout, I have:

offerTitle)){
print 'Site Name';
}
else
{
print ''.$this->offerTitle.'';
}
?>

And in one of my controllers, I have:

$this->offerTitle = 'Test Promotion';

However, I always get a notice-level warning from PHP that the variable 
doesn't exist, and I can't seem to set this variable.  I also tried 
$this->set('offerTitle', 'Test Promotion');

So my question is, how can I set dynamic data from my controllers and 
have the correct data displayed in my default layout?

2.  I seem to be getting different renders depending on where in the app 
I am.  For example, on the home section, everything looks as it should, 
yet when I go into a different section, I seem to be missing an image 
block at the top of the page.

The offending links are as follows:

http://resortscope.com/devel/cms/index.php
http://resortscope.com/devel/cms/offers/test

Any tips would be greatly appreciated!

-Erich-

--~--~-~--~~~---~--~~
 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: Element vs Helper

2006-11-16 Thread Erich C. Beyrent

What about a navigation menu, where the contents of the menu come from a 
database, and you want the menu to appear on all the pages?

What is the best way to approach this?

-Erich-

Christoph wrote:
>> Let me try and put it as simply as possibly
>> Element = snippet from a template which you just render in your
>> templates an example would be a dynamic menu which can be seen on all
>> pages
>> Helper = Some thing which helps you write otherwise repetitive but
>> somewhat complex HTML  in your templates abstracting away the
>> complexities in the call to its methods - the best example is the HTML
>> helper and the Form helper.

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

2006-11-16 Thread Erich C. Beyrent

I am just starting out with Cake, and my webhost does not use PHP5.  I 
have used the NuSOAP library before with success, so if you're like me 
and are stuck using PHP4, try this article to help you integrate NuSOAP 
with Cake:

http://rossoft.wordpress.com/2006/02/16/webservices-in-cakephp-other-approach/

-Erich-

[EMAIL PROTECTED] wrote:
> If you are interested in web services as RPC or SOAP, I have had some
> luck implementing both of those in cake. Here are a couple of article's
> describing the approach that I have taken.
> 
> http://bakery.cakephp.org/articles/view/137
> http://blog.itbytez.com/
> 
> 
> On Nov 15, 2:02 pm, "Christoph" <[EMAIL PROTECTED]> wrote:
>>> I don't have a solution, but I can confirm that I had the exact same
>>> results as you have. I suspect we need to do more than manual shows 
>>> us.Well, at least I'm not the only one.  Hopefully whoever is in charge of
>> writing the manual gets wind of the oversight that is in that part of
>> the manual...
>>
>> thnx,
>> Christoph
> 
> 
> > 

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



Default controller?

2006-11-09 Thread Erich C. Beyrent

Silly newbie question here.  I have followed the instructions in the 
manual to set up a default index page, with a new default.thtml layout, 
which echoes $content_for_layout.

What I would like to know is where does $content_for_layout get set?  Is 
there a default controller that gets called before anything else?  I ask 
because I want to set up some objects and stuff them into the sessions 
so that other controllers can access them.

What's the best way to accomplish this?

-Erich-

--~--~-~--~~~---~--~~
 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: SmartyView+SmartyHelpers

2006-11-03 Thread Erich C. Beyrent

Travis Cline wrote:
> I fixed up the issues I mentioned and had added defaultparameter passing.
> I'll post the new version up there in a bit (away from my dev
> environment right now).
>
> I'd like to figure out a way to combine the ideas.
>
> >
>   
So if I want to use Smarty with CakePHP, I must be using PHP5, or I am 
stuck with the thtml solution?  Do you plan on making this PHP4 compatible?

-Erich-

--~--~-~--~~~---~--~~
 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 associations question (foreign keys)

2006-10-24 Thread Erich C. Beyrent

> Defining your schema and having the database engine enforce key  
> integrity has its advantages and disadvantages. You'll probably want  
> to continue to learn about the issues regarding telling mySQL about  
> foreign keys.

What about us poor schmucks who are trying to develop applications using
Cake against an existing database?  Because of the amount of existing code
that uses this database, I can't go around changing the schema to conform to
Cake's expectations, and the problem I am having is that many of the built
in functions don't work.  

Is there some way to do schema mapping, or is this a case where I'll need to
define my own custom queries for each model?

-Erich-


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



RE: Cakephp projects on subfolder best practice

2006-10-23 Thread Erich C. Beyrent








But what about multiple app directories? 
Can you create app directories called /portal, /stats. etc and have them
treated like separate apps within a single Cake installation?

 

-Erich-

 









From: Sonic Baker
[mailto:[EMAIL PROTECTED] 
Sent: Monday, October 23, 2006
11:20 AM
To: cake-php@googlegroups.com
Subject: Re: Cakephp projects on
subfolder best practice



 

Hi there,

I have my subdomain (e.g. app1.cake.localhost) pointing to
app/webroot/index.php.

I personally think this is the easiest best for me.

HTH,

Sonic





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






RE: Scaffolding

2006-10-19 Thread Erich C. Beyrent

Right - some of the tables are quite large.  I increased the memory limit in
php.ini from 8mb to 16mb, but might go larger if this is an issue.

Scaffolding out of the box doesn't paginate, does it?  I suppose if want
that, I'll have to right my own logic in the controller...



-Original Message-
From: John David Anderson (_psychic_) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 19, 2006 3:14 PM
To: cake-php@googlegroups.com
Subject: Re: Scaffolding



On Oct 19, 2006, at 1:00 PM, Erich C. Beyrent wrote:

>
> Hi John,
>
> DEBUG was set to 3.  Nothing is visible in the source.  And then I  
> checked
> the error_log as you suggested, and there it was:
>
> PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted  
> (tried to
> allocate 2557952 bytes) in /cake/libs/view/view.php on line 594

Do you have large amounts of data loading up from that table?  
Scaffolding will try to list all the rows in the table, and that goes  
into memory at some point...

-- John




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



RE: Scaffolding

2006-10-19 Thread Erich C. Beyrent

Hi John,

DEBUG was set to 3.  Nothing is visible in the source.  And then I checked
the error_log as you suggested, and there it was:

PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to
allocate 2557952 bytes) in /cake/libs/view/view.php on line 594

-Erich-

-Original Message-
From: John David Anderson (_psychic_) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 19, 2006 2:51 PM
To: cake-php@googlegroups.com
Subject: Re: Scaffolding



On Oct 19, 2006, at 12:37 PM, Erich wrote:
> And nothing is displayed!  I am missing something so fundamental
> here that I ought to be shot, but I have no idea what's wrong.  I get
> nothing but a blank page - no errors, warnings, etc.

Have you set DEBUG to a value greater than 0?

Apache logs yield any wisdom?

If you view source, do you see anything?

-- John




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