开发者

Question about the code of the backend of symfony

开发者 https://www.devze.com 2022-12-23 02:56 出处:网络
this is the index action and template generated at the backend for the model \"coche\". public function executeIndex(sfWebRequest $request)

this is the index action and template generated at the backend for the model "coche".

public function executeIndex(sfWebRequest $request)
   {
     // sorting
     if ($request->getParameter('sort') &&
$this->isValidSortColumn($request->getParameter('sort')))
     {
       $this->setSort(array($request->getParameter('sort'),
$request->getParameter('sort_type')));
     }

     // pager
     if ($request->getParameter('page'))
     {
       $this->setPage($request->getParameter('page'));
     }

     $this->pager = $this->getPager();
     $this->sort = $this->getSort();
   }

This is the index template:

<?php use_helper('I18N', 'Date') ?>
<?php include_partial('coche/assets') ?>

<div id="sf_admin_container">
<h1><?php echo __('Coche List',开发者_运维知识库 array(), 'messages') ?></h1>

<?php include_partial('coche/flashes') ?>

<div id="sf_admin_header">
<?php include_partial('coche/list_header', array('pager' => $pager)) ?>
</div>

<div id="sf_admin_bar">
<?php include_partial('coche/filters', array('form' => $filters,
'configuration' => $configuration)) ?>
</div>

<div id="sf_admin_content">
<form action="<?php echo url_for('coche_coche_collection',
array('action' => 'batch')) ?>" method="post">
<?php include_partial('coche/list', array('pager' => $pager, 'sort' =>
$sort, 'helper' => $helper)) ?>
<ul class="sf_admin_actions">
<?php include_partial('coche/list_batch_actions', array('helper' =>
$helper)) ?>
<?php include_partial('coche/list_actions', array('helper' => $helper)) ?>
</ul>
</form>
</div>

<div id="sf_admin_footer">
<?php include_partial('coche/list_footer', array('pager' => $pager)) ?>
</div>
</div>

In the template there is this line:

include_partial('coche/filters', array('form' => $filters,
'configuration' => $configuration)) ?>

but i can not find the variables $this->filters and $this->configuration in the index action.

How is that possible?

Javi


Is the index action extending a class? If yes, that's how!


It looks like a module generated by admin generator. If it's so, then these vars are set in autoCocheActions class which resides in project cache and is generated on the fly.

0

精彩评论

暂无评论...
验证码 换一张
取 消