08.22
php
saved
rafaelbandeira3
Note
That's the result of the implementations, I'm not exposing the implementation itself because I'm looking forward for nice subjects for posting and code releases... spread the word and knowledge, and stuff :) ... lets say I'm really excited about having made a boom in my carrer by introducing cakephp in my company - and for having invested uncountable hours reading, testing and debugging cakephp stuffs!
That's the result of the implementations, I'm not exposing the implementation itself because I'm looking forward for nice subjects for posting and code releases... spread the word and knowledge, and stuff :) ... lets say I'm really excited about having made a boom in my carrer by introducing cakephp in my company - and for having invested uncountable hours reading, testing and debugging cakephp stuffs!
- // controller actions
- function schedules()
- {
- $this->Employee->contain('Schedule');
- $data = $this->Employee->findById($this->AppAuth->User->id);
- return $data;
- }
- // with more than one var setted
- function timesheet()
- {
- [...]
- {
- '{}.' . $this->Employee->WorkTime->alias . '.' . $this->Employee->WorkTime->primaryKey
- ,$data
- ))
- ));
- }
- $from = $passedParams['from'];
- $to = $passedParams['to'];
- return $data;
- }
- // var $data raw usage
- // example 1 ... wich is a little bit more readable, but I don't like it... actually i prohibited them to do that :)
- <ul class="List">
- <li class="Entry <?php echo $count%2?'odd':'even' ?>">
- <dl class="Primary Field DisplayField">
- <dt class="Name">
- Empresa
- </dt>
- <dd class="Value">
- 'model' => 'company',
- 'action' => 'edit', $Company['id'])) ?>
- </dd>
- </dl>
- <dl class="Association Field DisplayField">
- <dt class="Name">
- Contato
- </dt>
- // example 2
- <?php else: ?>
- <ul class="List">
- <?php foreach($data as $entry): ?>
- <li class="Entry">
- <dl class="Field DisplayField">
- <dt class="Name">
- Nome
- </dt>
- <dd class="Value">
- </dd>
- </dl>
- ////////////////////////////////////////////
- // Helper Example
- function beforeRender()
- {
- $View =& ClassRegistry::getObject('View');
- {
- $this->data = $View->viewVars['data'];
- }
- return true;
- }
- // With the helper, in the view
- <thead>
- <tr>
- <?php
- ?>
- </tr>
- </thead>
- <tbody>
- <?php while($view->next()): ?>
- <tr class="Entry">
- <?php
- ?>
- </tr>
- <?php endwhile ?>
- </tbody>
Parsed in 0.216 seconds, using GeSHi 1.0.7.14