Re: looking for competant cake php program to to some programming

2012-06-29 Thread Chetan Patel
Hello sir,

I have vast experience in cakephp

Read my blog :
http://chetan4cake.blogspot.in/

Thanks
Chetan



On Fri, Jun 29, 2012 at 4:33 PM, DiabloGeto wrote:

>
>
> you need to tell , some details about the project ,or should precisely
>>> know which portion of the project is incomplete.
>>
>>   --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: One model, multiple pagination in a single view with conditions?

2012-06-29 Thread 42startups
Gah that'd be right. First time jumping into CakePHP, the project I'm 
working on needs pagination of HABTM model (which was difficult), and 
multiple pagination of one model on the same view (which is impossible). I 
could have sorted these problems in no time with pure PHP.

Oh well, I ended up going with a simple iframe to have multiple pagination 
on the same page. A cheap hack, but it works.

Cheers

On Thursday, June 28, 2012 4:00:59 AM UTC+10, Mark Wratten wrote:
>
> You can only paginate one way at a time, so presumably you can set the 
> associations dynamically depending on the parameters from jQuery. Though 
> separate models might be cleaner as you can hard-code the associations.
>
> Mark
>
> On Monday, June 25, 2012 11:41:16 PM UTC-4, 42startups wrote:
>>
>> As the title suggests, is there a simple way to do this?
>>
>> Or should I create a separate model?
>>
>> Here's the code:
>>
>> $this->paginate = array('limit'=>30); 
>> $this->Hashtag->Pin->bindModel(array('hasOne' => array('HashtagsPin')), 
>> false);
>> $this->set('hashtag', $this->paginate('Pin', 
>> array('HashtagsPin.hashtag_id' => $id)));
>> $this->set('thought', $this->paginate('Pin', 
>> array('HashtagsPin.hashtag_id' => $id,'Pin.url'=>null))); 
>>
>> So I need to paginate 'hashtag' and 'thought' separately. I'll be 
>> attaching infinite scroll jquery to both.
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Ilie

>
>
> However, suppose the content editors want to write an article about 
> farmers markets and they want to display a list of farmers markets in the 
> local area, we can tell them to embed something like 
> {/organizations/list/tag:farmers-markets/radius:10/count:5} in the content. 
> Or somewhere else they want a list of music events, then we would tell them 
> to embed {/events/list/tag:music/radius:75/count:10}. So by passing that 
> URL to requestAction, it will call the appropriate controller and action 
> and return the rendered content. It keeps the code simple and modular, in 
> the spirit of MVC. 
>

What I am suggesting is slightly different... instead of having *one* 
requestAction *for each* of the modules you need included, I suggest to 
have only *one* requestAction *for all the modules on the page.* This would 
cut the overhead of rebuilding the Cake API for every module on the page. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Redirect to Different Action in If Statement

2012-06-29 Thread kwixson
Thank you very much! I'll give that a try.

Cheers,
-Kevin

On Thursday, June 28, 2012 7:45:08 AM UTC-4, MaJerle.Eu wrote:
>
> in your controller
>
> $this->redirect(array('action' => 'view'));
> --
> Lep pozdrav, Tilen Majerle
> http://majerle.eu
>
>
>
> 2012/6/28 kwixson 
>
>> How do I redirect a user from the index action to the view action if the 
>> user has a particular role (i.e., member, as opposed to admin?
>>
>> Note: I do NOT want to hear about routes. That might be the right way to 
>> go generally, but in this case it's not. I just want to know how to do an 
>> IF statement in the index action that will redirect the user to the view 
>> action. 
>>
>> Thank you.
>>
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/cake-php
>>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Completely blank screen after form submission

2012-06-29 Thread Shosho
In my app, for certain records, after save is clicked, it shows a completely
blank page. The url is pointing at my add view with no id passed. The number
it does this on is a small percentage of them. It works fine and exactly as
I expect it too on all the rest. I have no more ideas as to what it could
be. My add function is below. It's really weird that it would work just fine
on 95% of them but not the rest. Maybe it's something in the data coming in?
But i'm also using the security component, could be that?

function add($id = null) {
  $drug = $this->FrenchTranslation->Drug->read(
array(
   
'Drug.id','Drug.generic','Drug.ahl','Drug.aap','Drug.rid','Drug.oral','Drug.mw','Drug.clinical_recommendations','Drug.category','Drug.lrc','Drug.lrc2','Drug.lrc3','Drug.vd','Drug.rid_range_rounded','Drug.adultdose'
),
$id
  );
  //$this->set('drug',$drug);
  $this->set(compact('drug'));

  if (!empty($this->data)) {
$this->FrenchTranslation->create();
if ($this->FrenchTranslation->save($this->data)) {
  if(isset($this->params['form']['Next']) &&
$this->params['form']['Next']  == 'Next'){
$this->next($id, $this->data['FrenchTranslation']['generic']);
  }
  if(isset($this->params['form']['Previous']) &&
$this->params['form']['Previous'] == 'Previous'){
$this->previous($id, $this->data['FrenchTranslation']['generic']);
  }
  if(!isset($this->params['form']['Previous']) &&
!isset($this->params['form']['Next'])){
$this->Session->setFlash(__('The french translation has been saved',
true));
//$this->redirect(array('action' =>
'edit',$this->data['FrenchTranslation']['id']));
$this->redirect(array('action' => 'edit',$id));
  }
} else {
$this->Session->setFlash(__('The french translation 
could not be saved.
Please, try again.', true));
}
}
$drugs = $this->FrenchTranslation->Drug->find('list');
$this->set(compact('drugs'));
}

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Completely-blank-screen-after-form-submission-tp5709166.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Query and exporting to csv

2012-06-29 Thread Shosho
I'm trying to export certain information to a CSV file. I have a drop down
list to select the drug you want to generate the information for and it
sends the id to the function to generate the csv(That is sending the correct
ID selected). The query runs and gets the information I want, I use it in
another view, but i'm having issues getting the data to get put into the
csv. I'm not sure what else to try. It doesn't put anything into the csv
despite accessing it the same way I do in the view. Any help is appreciated.

Functions:
  function report(){
$this->set('alldrugs', $this->Drug->find('list', array(
  'cache' => 'drugList',
  'cacheConfig' => 'sql',
  'fields' => array('id', 'generic'), 
  'order' => 'Drug.generic', 
  'recursive' => -1,
)));
if (!empty($this->data['DrugCalls'])) {
 
$this->redirect(array('controller'=>'drugs','action'=>'generatePatientInfo',$this->data['DrugCalls']['DrugList']['id']));
  }
  }
  function generatePatientInfo($id=null) {
$this->layout = 'ajax';
// get drug info
$drug = $this->Drug->read(
  array(
'Drug.id', 'Drug.generic'
  ), 
  $id
);
$this->set('drug',$drug);
$patients = $this->Drug->query('SELECT patients.id, calls.id call_id,
patients.first_name, patients.last_name, calls.created '
  . 'FROM drugs, drug_lactation_links, lactation, calls, patients '
  . 'WHERE drugs.id = ' . $id . ' AND drugs.id =
drug_lactation_links.drug_id AND '
  . 'drug_lactation_links.lactation_id = lactation.id AND
lactation.call_id = calls.id AND calls.patient_id = patients.id '
  . 'UNION '
  . 'SELECT patients.id, calls.id call_id, patients.first_name,
patients.last_name, calls.created '
  . 'FROM drugs, drug_pregnancy_links, pregnancies, calls, patients '
  . 'WHERE drugs.id = ' . $id . ' AND drugs.id =
drug_pregnancy_links.drug_id AND '
  . 'drug_pregnancy_links.pregnancy_id = pregnancies.id AND
pregnancies.call_id = calls.id AND calls.patient_id = patients.id '
  . 'ORDER BY created DESC'
);
$this->set(compact('patients'));
  }


View:
addRow(array('Enter Generic: ' . $drug['Drug']['generic']));
$csv->addRow($header);

// add all the data
foreach($patient_list as $patient) {
  $csv->addRow(array(
$patient[0]['first_name'],
$patient[0]['last_name'],
  ));
}
$csv->addRow(array());

// render the CSV file
echo $csv->render('Patients-list.csv');
?>


--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Query-and-exporting-to-csv-tp5709159.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined index after web host install.

2012-06-29 Thread lowpass
On Fri, Jun 29, 2012 at 3:01 PM, Guti Grewal  wrote:
> Notice (8): Undefined index:  Upload [APP/Controller/UploadsController.php,
> line 32]
>
> /app/Controller/UploadsController.php (line 32)
>
> null
>
>
> This is what I get, when I do the debug, so Im guessing theres no errors
> with the coding. Where else could the error be.

Well, no, it doesn't mean there are no errors. It means that
$this->request->data is empty. Which is not what you want. Where did
you put this line? Normally, it would be something like:

public function add()
{
if (!empty($this->request->data))
{
// do save here
debug($this->request->data);


Which version are you running, btw? If less than 2.x you need to
debug($this->data) instead.

It's odd that both the notice and the debug are on line 32. What does
your controller action look like?

> It works fine in localhost but once I uploaded it to the online web host I
> get thrown this error.

Then maybe the problem is that you're trying to upload a file that's
too large. Or you may not even be able to upload at all. Add this in
your controller:

debug($_FILES);

If there's an upload error it'll be included there and you can compare
with the examples on the PHP site.

Also, you could check the server's config. Write a script, info.php,
and stick it in your webroot dir:

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Mark Wratten
On Friday, June 29, 2012 12:30:39 AM UTC-4, Ilie wrote:
>
> Hello,
>
> Another way to do this is to have one controller requestAction to fetch 
> (as array or objects) all the data you need to render your modules, then 
> using Elements or View Blocks to do the actual rendering of the modules.
>
Yes, that's exactly what I'm doing to assemble the modules. With view 
blocks, we can divide the page into panels and create a view block for each 
panel, so by specifying a panel attribute in the module, we can render each 
module in the specified panel and assemble the layout in the common view. 
That part is working very well.

However, suppose the content editors want to write an article about farmers 
markets and they want to display a list of farmers markets in the local 
area, we can tell them to embed something like 
{/organizations/list/tag:farmers-markets/radius:10/count:5} in the content. 
Or somewhere else they want a list of music events, then we would tell them 
to embed {/events/list/tag:music/radius:75/count:10}. So by passing that 
URL to requestAction, it will call the appropriate controller and action 
and return the rendered content. It keeps the code simple and modular, in 
the spirit of MVC. We are doing a form of that in Cake 1.1 right now but 
the rendering time is a bit longer than I would like. I suppose we can 
create our own version of the dispatcher, though I'm not sure of the 
benefit vs. maintainability. 

As you say, caching is important and we do do that, so really it is the 
first time hit that counts.

Mark

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: not found error when naming views.ctp files in arabic

2012-06-29 Thread MSayyaf
the problem is with encoding :(
 
http://stackoverflow.com/questions/6634832/file-exists-and-file-get-contents-fail-on-a-file-which-is-named-output/6634924#6634924
 

On Friday, June 29, 2012 7:36:03 PM UTC+2, MSayyaf wrote:

> I had a problem with naming views.ctp files in arabic language and calling 
> them with CakePHP2.0.
>
> So I've done this:
> - created a view file, naming it in arabic and set it under 
> app/views/pages/myNameInArabic.ctp
> - in app/views/layouts/default.ctp file i put a link to it:
> echo $this->Html->link('link', array('controller'=>'pages', 
> 'action'=>'صفحة'));
>
> when i clicked the link:
> - url bacame: http://localhost/MySite/pages/صفحة
> - and got the following error:
> Error: The view for PagesController::display() was not found.
> Error: Confirm you have created the file: 
> F:\xampp\htdocs\TestLocal\app\View\Pages\صفحة.ctp
> etc etc
>
> thanks
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined index after web host install.

2012-06-29 Thread Guti Grewal


*Notice* (8): Undefined index:  Upload [*APP/Controller/UploadsController.php*, 
line *32*]

*/app/Controller/UploadsController.php* (line *32*)

null


This is what I get, when I do the debug, so Im guessing theres no errors with 
the coding. Where else could the error be. 

It works fine in localhost but once I uploaded it to the online web host I get 
thrown this error. 


This is my form;

Form->create('Upload', 
array('controller'=>'uploads','action'=>'add','type' => 'file', 
'class'=>'uploadfrm'));?>

Upload a Video
.mp4 file format only.';
echo '';
echo '';
echo $this->Form->input('name', array('between'=>'', 
'class'=>'input'));
echo $this->Form->input('eventname', array('between'=>'', 
'class'=>'input'));
echo $this->Form->input('description', array('between'=>'', 'rows'=> '7', 'cols'=> '60', 'class'=>'input'));
echo  $this->Form->hidden('userid', array('id' => 
'user_id','value' => $auth['id']));
echo $this->Form->hidden('username', array('id' => 'username', 
'value' => $auth['username']));
echo $this->Form->input('file', array('type' => 'file'));

echo "";
?>
Form->end(__('Upload Video', true));?>



Any ideas?


On Thursday, 28 June 2012 22:34:09 UTC+1, Guti Grewal wrote:
>
> Hi I've uploaded my website on a free hosting site called 000webhost, it 
> works fine on localhost but however when I try to upload a file to the 
> server using a form I get thrown this error.
>
> *Notice* (8): Undefined index:  Upload 
> [*APP/Controller/UploadsController.php*, line *32*]
> Code
>
> UploadsController::add() - APP/Controller/UploadsController.php, line 32
> ReflectionMethod::invokeArgs() - [internal], line ??
> Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485
> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103
> Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85
> [main] - APP/webroot/index.php, line 96
>
>
> I can't for the life of me figure out what is going wrong?
>
> I've set the permissions for the webroot/files/uploads folder to 777, so it 
> can't possibly be that. 
>
> Anyone have any ideas?
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Routes with slugs, pagination problem

2012-06-29 Thread lowpass
Router::connect(
'/:slug',
array(
'controller' => 'categories',
'action' => 'view'
),
array(
'slug' => '[-a-z0-9]+',
'pass' => array('slug')
)
);
Router::connect(
'/:slug/:page',
array(
'controller' => 'categories',
'action' => 'view'
),
array(
'slug' => '[-a-z0-9]+',
'page' => '[0-9]+',
'pass' => array('slug')
)
);

And I had to put the following in AppController::beforeFilter when I
upgraded to 2.x:

if (isset($this->request->params['page']))
{
$this->request->params['named']['page'] = 
$this->request->params['page'];
}

On Thu, Jun 28, 2012 at 6:10 PM, Ovidiu Marinoiu
 wrote:
> Hello,
>
> I have created a route which looks like this Router::connect('/:slug',
> array('controller' => 'categories', 'action' => 'view'), array('pass' =>
> array('slug')));
>
> Until here, everything works okey, visiting the
> link http://example.com/animals-and-pets, works perfect.
>
> On this page I have a pagination and this gives me e big problem, the links
> for the pages, are generating wrong, like
> this: http://example.com/categories/view/animals-and-pets/page:2.
>
> The result that I want to obtain is http://example.com/animals-and-pets/2.
>
> Thanks for your help in advance!
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined index after web host install.

2012-06-29 Thread lowpass
It looks to me like your code is expecting a key, 'Upload' in the
request data. What does your form look like?

Also, debug($this->request-data)

On Thu, Jun 28, 2012 at 5:34 PM, Guti Grewal  wrote:
> Hi I've uploaded my website on a free hosting site called 000webhost, it
> works fine on localhost but however when I try to upload a file to the
> server using a form I get thrown this error.
>
> Notice (8): Undefined index:  Upload [APP/Controller/UploadsController.php,
> line 32]
> Code
>
> UploadsController::add() - APP/Controller/UploadsController.php, line 32
> ReflectionMethod::invokeArgs() - [internal], line ??
> Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485
> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103
> Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85
> [main] - APP/webroot/index.php, line 96
>
>
> I can't for the life of me figure out what is going wrong?
>
> I've set the permissions for the webroot/files/uploads folder to 777, so it
> can't possibly be that.
>
> Anyone have any ideas?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cant access multiple textboxes values

2012-06-29 Thread lowpass
debug($this->data)

Or debug($this->request->data) if using 2.x.

On Thu, Jun 28, 2012 at 8:52 AM, Ditshwanelo  wrote:
> Im using multiple textboxes with the same name want to get values from the
> form i knw in PHP we use get bt i tried cake is not working,please help
> This is my textbox: />
>    id="description" />
>     id="description" />
> ,how do i access this in my controller using $this->data[Mymodel][Name] and
> get each textbox vale according its index
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP home page after Bake is Blank

2012-06-29 Thread MSayyaf
- after you add php path to windows PATH variable
  try this:
- open cmd
- go to path ...\YourSite\lib\cake\console
- execute the follwing command line: php cake.php bake
- then choose what you want to bake and go on.
 

On Thursday, June 28, 2012 11:43:24 PM UTC+2, Miles G wrote:

> Hi, I'm working with cakephp version 2.1.3. I can make a project and make 
> my model/controller/view and it all connects to database and works fine. As 
> soon as I bake a project and try to access the home page it's a blank page.
>
> I've tried deleting my cache files (not directories), and it didn't help.
>
> I don't think the bake is working correctly - Screenshot
>
> You can see in the picture it is asking me if I want to overwrite a file, 
> but the folder "Items" didn't exist until I did "cake bake Items", so I 
> don't see how it has anything to overwrite?
>
> Blank screen  - This should be cake's default home 
> page where it tells you your php version, that you are connected to the 
> database, etc.
>
> It seems to me like there is some sort of bug with cake bake?
>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


not found error when naming views.ctp files in arabic

2012-06-29 Thread MSayyaf


I had a problem with naming views.ctp files in arabic language and calling 
them with CakePHP2.0.

So I've done this:
- created a view file, naming it in arabic and set it under 
app/views/pages/myNameInArabic.ctp
- in app/views/layouts/default.ctp file i put a link to it:
echo $this->Html->link('link', array('controller'=>'pages', 
'action'=>'صفحة'));

when i clicked the link:
- url bacame: http://localhost/MySite/pages/صفحة
- and got the following error:
Error: The view for PagesController::display() was not found.
Error: Confirm you have created the file: 
F:\xampp\htdocs\TestLocal\app\View\Pages\صفحة.ctp
etc etc

thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Dr. Tarique Sani
Err... Larry, the book warns "If used without caching requestAction
can lead to poor performance. It is rarely appropriate to use in a
controller or model." and I can attest to poor performance of RA

What are we missing here?

Tarique

On Fri, Jun 29, 2012 at 5:36 PM, Larry E. Masters  wrote:
> Why is there an assumption that RA is something to avoid? This is
> misinformation that has been passed around too long.
>
> --
> Larry E. Masters
>
>
> On Fri, Jun 29, 2012 at 6:51 AM, Dr. Tarique Sani 
> wrote:
>>
>> On Fri, Jun 29, 2012 at 10:00 AM, Ilie  wrote:
>> > Hello,
>> >
>> > Another way to do this is to have one controller requestAction to fetch
>> > (as
>> > array or objects) all the data you need to render your modules, then
>> > using
>> > Elements or View Blocks to do the actual rendering of the modules.
>>
>> requestAction is the thing to avoid :D
>>
>> Tarique
>>
>> --
>> =
>> PHP for E-Biz: http://sanisoft.com
>> =
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Larry E. Masters
Why is there an assumption that RA is something to avoid? This is
misinformation that has been passed around too long.

-- 
Larry E. Masters


On Fri, Jun 29, 2012 at 6:51 AM, Dr. Tarique Sani wrote:

> On Fri, Jun 29, 2012 at 10:00 AM, Ilie  wrote:
> > Hello,
> >
> > Another way to do this is to have one controller requestAction to fetch
> (as
> > array or objects) all the data you need to render your modules, then
> using
> > Elements or View Blocks to do the actual rendering of the modules.
>
> requestAction is the thing to avoid :D
>
> Tarique
>
> --
> =
> PHP for E-Biz: http://sanisoft.com
> =
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Dr. Tarique Sani
On Fri, Jun 29, 2012 at 10:00 AM, Ilie  wrote:
> Hello,
>
> Another way to do this is to have one controller requestAction to fetch (as
> array or objects) all the data you need to render your modules, then using
> Elements or View Blocks to do the actual rendering of the modules.

requestAction is the thing to avoid :D

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there a lighter weight alternative to requestAction?

2012-06-29 Thread Ilie
Hello,

Another way to do this is to have one controller requestAction to fetch (as 
array or objects) all the data you need to render your modules, then using 
Elements or View Blocks to do the actual rendering of the modules.

For example in your AppController beforeFilter method  you could have 
something like:

$this->requestAction( 
"/modules/loadData/$currentController/$currentAction").

and the "loadData" action in the "modules" controller would load and set 
all the required data for the modules on the requested page. It could even 
load and set a list of elements and positions to be rendered into! 

Next in your view (or layout) render this module data you've just loaded, 
around the main view of the requested action. 

So, even very complex websites can be modeled as a MVC, but the model 
becomes much more complex (like a list of modules, page elements and so on) 
as opposed of a single table associated with a controller.

With a smart use of the caching system this should work fine. 

In conclusion, redesign the app so that you will get all the data you need 
with only ONE requestAction...

PS: Thinking about this more deeply, I believe that with a smart usage of 
AppController:beforeFilter, you may not even need to use requestAction at 
all. You could instead fetch everything you need directly from the 
AppController. 

On Thursday, June 28, 2012 9:25:06 PM UTC+3, Mark Wratten wrote:
>
> That's the dilemma we are facing. The traditional MVC paradigm where a URL 
> maps to a controller and action is fine for simple sites, but for more 
> complex sites the model falls apart. Our site started as a straightforward 
> MVC design, but then the users wanted to add their own landing pages and 
> control what appears on each page. It is not practical to create a new 
> controller/action/view for each new landing page so the site became a 
> hybrid of traditional MVC and a CMS with the ability to embed active 
> content.
>
> @Florian, that's essentially what we are doing. For the updated design, we 
> are routing all requests to a single controller/action/view and using a 
> Helper to embed modules in the content. The module positions are 
> represented by tokens in the content, so we don't know which modules to 
> load until rendering the view. As most of the modules are active content we 
> need to use requestAction to assemble the module content from data in the 
> database and render in the view. Because requestAction loads a new 
> environment it adds a significant overhead especially when loading a lot of 
> modules. And it also involves a bit of a kludge to change the routing on 
> the fly. It is working, but I feel it could be done in a cleaner, simpler, 
> more efficient way, but I am struggling how to figure out how to do that 
> and stay within the Cake paradigm.
>
> Mark
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Dynamic form elements

2012-06-29 Thread roly
Hi Everyone

I'm trying to add dynamic elements to a form, I have this strcuture:

Event hasmany Tickets

So an event can have 0 to * tickets. I use this javascript function to add 
the tickets to the form:

function AddNewTicket()
{

$('#divTickets').append(" NamePriceQuantityDescriptionStart 
DateEnd Date
");
   

currentFields++;


return false;
}

And it adds the elements fine but the validation/saving it's not working 
for the tickets.

I'm using the 2.1.3 version. Any help is welcome.

Cheers

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0 HttpSocket and HttpResponse empty

2012-06-29 Thread Bui Minh Truong
Hi,

I dont have any HttpResponse class or plugin. I only use core CakePHP class.
And as you see,  $responseClass is HttpResponse.

Even I tried to use new fresh application, and added those sample code, but 
I got nothing.
Is any requirements of PHP?

Thank you,
M.Truong.

On Thursday, June 28, 2012 3:46:29 PM UTC+7, Bui Minh Truong wrote:
>
> Hi all,
>
> Sorry if there was any thread about my problem (I did search that problem 
> but I was unlucky).
>
> I used instruction of HttpSocket on this page: 
>
> http://book.cakephp.org/2.0/en/core-utility-libraries/httpsocket.html 
>
> My request was created and it actually requested target host, but there 
> was an empty response.
> I debugged 2 classes of CakePHP : HttpSocket and HttpResponse, then I 
> found that:
>
> In HttpSocket : (\lib\Cake\Network\Http)  Line 397:
> $this->response = new $responseClass($response); 
> $response is not empty but $this->response is empty, though $responseClass 
> is HttpResponse.
>
> In HttpResponse: no constructor called.
>
> Could anyone help us to understand this problem.
>
> Thank you,
> M.Truong.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0 HttpSocket and HttpResponse empty

2012-06-29 Thread Steve Found

On 28/06/12 09:46, Bui Minh Truong wrote:

Hi all,

Sorry if there was any thread about my problem (I did search that 
problem but I was unlucky).


I used instruction of HttpSocket on this page:

http://book.cakephp.org/2.0/en/core-utility-libraries/httpsocket.html

My request was created and it actually requested target host, but 
there was an empty response.
I debugged 2 classes of CakePHP : HttpSocket and HttpResponse, then I 
found that:


In HttpSocket : (\lib\Cake\Network\Http)  Line 397:
$this->response = new $responseClass($response);
$response is not empty but $this->response is empty, 
though $responseClass is HttpResponse.


In HttpResponse: no constructor called.

Could anyone help us to understand this problem.

Thank you,
M.Truong.
--
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and 
help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php


Do you have your own HttpResponse class in your app or plugins that 
could be overriding the one from the core ?


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: looking for competant cake php program to to some programming

2012-06-29 Thread DiabloGeto


you need to tell , some details about the project ,or should precisely know 
>> which portion of the project is incomplete.
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php