User Profile
- User
- Siegfried
- Location
- Munich, Germany
- Time Zone
- (GMT 1): Austria, Belgium, Cameroon, France, Germany, Italy, Spain
- URL
- http://cakery.de
- Bio
- Blogging about CakePHP in German on my site. Using CakePHP for more than 2 years now and open for requests.
Recent Articles
cakeinfo() helper for cakePHP
As a newbie in cakePHP it is often hard to get all the constants right and not always easy to recognise, what is already defined in the cakePHP core of constants.
- Published by Siegfried 03/13/07 - 13:21
- 9498 views
- 1 comment







Take a look at the connect() in the code. There you can see how the path is constructed. There is also a debug statement, which you can uncomment to show you the exact path on your server.
As I have written in the docs above the code, only a few options are handled at the moment. They are:
Conditions is one thing I want to add in the future, which should not be to hard. But "order by" does not make a lot of sense, cause in CSV you have no index like in a database. As you know CSV-files are just flat text files.
So this is the right version again for all who have changed the behavior according to comment #20
function __getContent($file) {
return $file['type'];
}
So I implemented a small extension and now it is easy to change the steps in the process
function processstep1()
{
if ($this->flag1 > 0) {
$this->Wizard->setsteps($this->steps);
return true;
} else if ($this->flag1 == -1) {
$this->Wizard->setsteps(array('step1', 'stepx'));
return true;
}
// exit();
return false;
}
the setsteps is a new function in the wizard:
function setsteps($steps = null)
{
$this->Session->write($this->sessionKey.".Way", $steps);
$this->steps = $steps;
}
and in the Wizard::process there is also a small new part. Search for the "elseif(!is_null($step))" position and change to:
} elseif(!is_null($step)) {
// ---this is new--------- get the steps
if ($this->Session->check($this->sessionKey.".Way")) {
$this->steps = $this->Session->read($this->sessionKey.".Way");
}
// ---end of this is new---------
Hope this is a little help to someone.
I have one enhancement to note. If you have some logic, that involves for example a $model->saveField() in the rest of your programm, then the _parseTag function can not work, because in $model->data is only one field. So just before the _parseTag call I have included this line of code:
So _parseTag will only be called if the table_label field is in the current data of the model.if (array_key_exists($this->settings[$model->name]['table_label'], $model->data[$model->name])) {